OpenIddict integration
This quickstart guide covers the essential steps to start integrating Pangea AuthN with OpenIddict .
Create an OAuth client
Create a new OAuth client as described in OAuth Server with the following parameters:
- Grant Types: Authorization Code
- Response Types: Code, Token
- Allowed Redirect URIs:
[origin]/callback/login/pangea
- Allowed Scopes: openid, profile, email
- Default scopes: openid, profile, email
Note down the client ID (starts with "psa_") and client secret (starts with "pck_") for later.
Set up client
public void ConfigureServices(IServiceCollection services)
{
// ...
services
.AddOpenIddict()
.AddClient(options =>
{
options.AllowAuthorizationCodeFlow();
// ...
options.AddRegistration(new OpenIddictClientRegistration
{
ProviderName = "Pangea",
ProviderDisplayName = "Pangea",
Scopes = { Scopes.Email, Scopes.OpenId, Scopes.Profile },
Issuer = new Uri("https://pdn-222222.login.aws.us.pangea.cloud", UriKind.Absolute),
ConfigurationEndpoint = new Uri("https://pdn-222222.login.aws.us.pangea.cloud/.well-known/oauth-authorization-server", UriKind.Absolute),
Configuration = new OpenIddictConfiguration
{
AuthorizationEndpoint = new Uri("https://pdn-222222.login.aws.us.pangea.cloud/v2/oauth/authorize", UriKind.Absolute),
TokenEndpoint = new Uri("https://pdn-222222.login.aws.us.pangea.cloud/v2/oauth/token", UriKind.Absolute),
ResponseTypesSupported = { ResponseTypes.Code }
},
ClientId = "psa_000000",
ClientSecret = "pck_111111",
RedirectUri = new Uri("[origin]/callback/login/pangea", UriKind.Absolute),
});
})
// ...
}
Was this article helpful?