Implementation
Last updated
Last updated
Login in with GlobaliD is where you redirect users to log in with GlobaliD, after which they are redirected back to your app with an authorization code
.
When users navigate to your Login with the GlobaliD URL, they are presented with a QR code that they must scan with their GlobaliD mobile app. If they do not have the GlobaliD mobile app, they can scan the QR code to get a link to the mobile app in the or on . From there, they will need to sign up for a GlobaliD account.
This document assumes you have a .
You can implement the flow without using a library. Still, we recommend you use one of based on your language or any other OAuth/OpenID library. It will greatly help you if this is your first time implementing OAuth/OpenID. Here is some basic information you will need to log in with GlobaliD.
On the GlobaliD authorization page, users will see a QR code; they must scan it with the GlobaliD mobile application to log in. They'll then be asked if they want to give your application access to their data. If they agree, the provider will redirect them back to your application.
GlobaliD will redirect the user to your application using the redirect URI you provided earlier. It will include an authorization code
as a parameter in this redirect.
Your application can now use the access token to request the provider's API on behalf of the user. The access token is included as a Bearer token in the Authorization header of the HTTP request.
Access tokens have a limited lifetime, and your application needs to handle cases where the token has expired. This could involve refreshing the token using a refresh token or redirecting the user back to the GlobaliD authorization page to log in.
Congratulations, you successfully implemented Login with GlobaliD
When the user wants to log in with GlobaliD, you must redirect them to the GlobaliD authorization page. The GlobaliD authorization page URL will include parameters like your client ID, the response type (usually "code" for OAuth2), and a redirect URI the provider will send the user back to after they've authorized your app. If you use one of the suggested libraries, you can generate this URL with them. We also suggest you use the - []. A few extra parameters are needed, but libraries will help you with them.
Your application can now make a POST request to the GlobaliD token endpoint, sending the authorization code, client ID, client secret, and the same redirect URI. In response, the provider will send back an access token ( it is that you can validate ). You can read a guide here if you don't know what JWT is.
Needed if you are doing PKCE
Needed if you are doing PKCE with S256
Redirect to the provided redirect_uri with an authorization code
No content