Learn how to integrate Discord OAuth authentication with Hanko for secure user login.
/thirdparty/callback
endpoint.
To find your redirect URL:
Organization
.Project
.Settings
, then select Identity providers
.Redirect URL
input.Applications
in the left sidebar.New Application
.Create
.OAuth2
in the left sidebar.Redirects
panel, click Add Redirect
.Redirect URL
you obtained in the previous step in the input that
appears.Save changes
.OAuth2
settings of your application, copy the Client ID
.Reset Secret
, follow the prompts to generate a new secret, then copy the generated secret.Settings
and select Identity providers
.hanko-elements
web components, this should be the page containing the component to handle errors properly.
hanko-elements
applications, this should be the page containing the authentication component.
https://*.example.com
matches https://foo.example.com
and https://bar.example.com
.https://foo.example.com/*
matches URLs like https://foo.example.com/page1
and https://foo.example.com/page2
.Providers
section, select Discord
and enable it using the toggle switch.Client ID
and Client Secret
you obtained from the Discord developer console.Save
to apply your configuration.@teamhanko/hanko-elements
@teamhanko/hanko-frontend-sdk
<hanko-auth>
component from @teamhanko/hanko-elements
into your application. Once configured, the component will automatically display a Discord sign-in button in the login interface.error redirect URL
as well as an
allowed redirect URL
(see the previous step).