AuthSession headers

#1

Is it possible to add additional headers to AuthSession? I need it to handle a JWT send by device on my callback route.

#2

The Expo AuthSession API is intended for web authentication flows (e.g. OAuth 2 for browsers) and we don’t support custom headers right now. If you’re building a login screen for your own service, you probably want to use fetch and build the login screen yourself instead of using AuthSession.

The Expo AuthSession API has a client-side piece and a server-side piece (hosted by Expo so you don’t have to). The server-side piece sends back a small HTML page that records some information (client-side) and then redirects the browser to open your auth provider’s page (ex: the Google login page). Since browser redirects specify only a URL – and not HTTP headers – the browser won’t send any custom HTTP headers. Since this same constraint exists if you were running in the browser, I’d expect most OAuth 2 providers – particularly ones that are intended to work with websites – not to need custom HTTP headers.

If you wish you specify custom HTTP headers, we recommend that you implement your own authentication flow that’s built on top of the Expo WebBrowser API for the client-side part. For the server-side part you’d write your own server.

#3

I’m having an issue with the redirecting uri, in standalone app it shows me a pago of expo saying that the page does not exist…