Learn how to integrate ZBD Login into your application.
ZBD Login
follows the RFC 6749 standards in order to provide the best and safest experience to users. ZBD’s OAuth2 implementation requires PKCE (Proof Key for Code Exchange) as an additional feature for making sure the entire authentication flow is secure.
access token
and a refresh token
.
The app must store the refresh token
for future use and use the access token
to fetch user data through the ZBD API. When the access token
expires, the app will use the refresh token
to request a new one.
ZBD Login - OAuth2 flow
authorization URL
as the destination address.
GET
https://api.zebedee.io/v1/oauth2/authorize
client_id
= <your clientId>response_type
= coderedirect_uri
= <your_url_callback>code_challenge_method
= S256code_challenge
= <code challenge generated from PKCE section>After accessing the ZBD login portal URL and successfully authenticating, the user will be redirected back to your application withstate
andcode
query parameters included. These two properties allow you to hit thetoken
endpoint, and get the user’saccessToken
.
POST
https://api.zebedee.io/v1/oauth2/token
code
returned from the previous authorization
endpoint, you must now make a POST
request to the token endpoint, with the following properties:accessToken
:GET
https://api.zebedee.io/v1/oauth2/user
accessToken
from the previous endpoint on the request authorization header.GET
https://api.zebedee.io/v1/oauth2/wallet
accessToken
from the previous endpoints on the request authorization header.Getting the Token
part, which is
a true secret and should be handled in your secure backend system services.ZBD Login
functionality, you must first get your application/game’s OAuth2 Client ID
and Client Secret
, and set up proper redirect URLs.
OAuth2
tab inside of that game’s single details view.
OAuth2 Menu - ZBD Developer Dashboard
Client ID
(first field) and Client Secret
(second field).
View Settings
button.
It is a requirement that the same redirect URL be used in the first step of the OAuth2 flow (authorization endpoint
) - if you set a redirect URL different from the one being used when building the authorization URL, or if you don’t set a redirect URL at all, the Authorization redirect will not work.
View OAuth2 Settings - ZBD Developer Dashboard
+
button.
Add Redirect URLs - ZBD Developer Dashboard
Update
. You’re now all set up for using ZBD Login
on your application. For more detailed examples check out the OAuth2 Code Walkthrough for source code and LOC explanation.