Server-side Redirects

When using server-side redirects you provide the URL of the API endpoint that will receive the token and other login session details as parameters. The native app will redirect the webview to this URL after a successful login. If the user has cancelled the login process, the error parameter will contain an error message.

Median JavaScript Bridge Methods and Parameters:

median.socialLogin.facebook.login({ 'redirectUri' : '<endpoint>', 'scope' : '<text>' });{ 'redirectUri' : '<endpoint>' });{ 'redirectUri' : '<endpoint>', 'scope' : '<text>' });

redirectUri - the GET endpoint that will be called after using the Social Login. The tokens will be added as GET parameters.
scope - determines what data your app would like access to. Check the official documentation for each of the social logins for more information.

Redirect URL API Endpoint parameters:

Identity ProviderStatusParametersExample
Facebook LoginSuccessaccessToken=STRING
Facebook LoginErrorerror=STRING
Google Sign-inSuccessidToken=STRING
Google Sign-inErrorerror=STRING
Sign in with AppleSuccessidToken=STRING
Sign in with AppleErrorerror=STRING


[1] User profile only sent for initial login

Apple only returns a user's complete profile with fields such as firstName and lastName the first time the user authenticates for your app. You must securely save the user profile information for future purposes as subsequent authorization requests will only contain an identity token in the form of JSON Web Token (JWT), authorization code, and user identifier to your app. Parsing the JWT will return additional fields such as email, email_verified, etc. Refer to this documentation for more info.


<button class="google-login native-only" 
  onclick="{ 'redirectUri' : '' });">
	Log in With Google

In this example, the Median JavaScript Bridge endpoint is activated when the anchor tag is clicked. After the user has logged in within the native app, the webview will be redirected to