Nakama Module for OpenId Connect

Hi Nakama loving folks.
I have been writing a submodule for Nakama, and this sub module is for OpenId Connect for external game services (My precise game service is Epic Online Services.)
To put it in simple words, I m writing a userInfo function (GET or POST) for expose user details to external services. And I need to set this userInfo function in EOS dashboard.

This is what happens

  1. I do email auth in my game using Nakama and get access token.
  2. I pass that access token EOS client SDK, and EOS client SDK passes that access token to its backend.
  3. And when EOS backend receives my access token they hit my configured userInfo endpoint along with the access token in the header.

The problem is that in the open id sub module I m able to access the payload (body) but I can’t access request header. I need to access header because EOS backend passes the access token in form beaer token, and once I get the header then I can query my user and return the user info to EOS.

The problem is: How do I access request header in my Go-module?

Thanks for the help.

@ANURAGX I think we’ll have to expose the request headers into the Go context for cloud code RPC functions to be able to access them. It might be easier in the meantime for you to run a separate HTTP server inside your Go module to handle the EOS OpenID callback.

is there any guide on how to run separate HTTP server in go module?
@novabyte

@ANURAGX You can just start a HTTP server from the Go stdlib and bind it to a separate port number. Have a look at a Go tutorial on how to create a simple HTTP server:

https://quii.gitbook.io/learn-go-with-tests/build-an-application/http-server