providers/asgardeo
AsgardeoProfile
The returned user profile from Asgardeo when using the profile callback.
Extends
Record
<string
,any
>
Properties
email: string;
The user email
given_name
given_name: string;
The user name
picture
picture: string;
The user profile picture
sub
sub: string;
The user Asgardeo account ID
default()
default(config): OIDCConfig<AsgardeoProfile>
Setup
Callback URL
https://example.com/api/auth/callback/asgardeo
Configuration
import { Auth } from "@auth/core"
import Asgarde from "@auth/core/providers/asgardeo";
const request = new Request(origin)
const response = await Auth(request, {
providers: [
Asgardeo({
clientId: ASGARDEO_CLIENT_ID,
clientSecret: ASGARDEO_CLIENT_SECRET,
issuer: ASGARDEO_ISSUER,
}),
],
})
Configuring Asgardeo
Follow these steps:
- Log into the Asgardeo console
- Next, go to “Application” tab (more info here)
- Register a standard based, Open ID connect, application
- Add the callback URLs:
http://localhost:3000/api/auth/callback/asgardeo
(development) andhttps://{YOUR_DOMAIN}.com/api/auth/callback/asgardeo
(production) - After registering the application, go to “Protocol” tab.
- Check
code
as the grant type. - Add “Authorized redirect URLs” & “Allowed origins fields”
- Make Email, First Name, Photo URL user attributes mandatory from the console.
Then, create a .env
file in the project root add the following entries:
ASGARDEO_CLIENT_ID="Copy client ID from protocol tab here"
ASGARDEO_CLIENT_SECRET="Copy client from protocol tab here"
ASGARDEO_ISSUER="Copy the issuer url from the info tab here"
Resources
Notes
The Asgardeo provider comes with a default configuration. To override the defaults for your use case, check out customizing a built-in OAuth provider.
By default, Auth.js assumes that the Asgardeo provider is based on the OAuth 2 spec
Help
If you think you found a bug in the default configuration, you can open an issue.
Auth.js strictly adheres to the specification and it cannot take responsibility for any deviation from the spec by the provider. You can open an issue, but if the problem is non-compliance with the spec, we might not pursue a resolution. You can ask for more help in Discussions.
Parameters
Parameter | Type |
---|---|
config | OIDCUserConfig <AsgardeoProfile > |