AspNet.Security.OAuth.AWSCognito allows you to authenticate against your AWS Cognito User Pool. This can be handy if your User Pool is associated with Social Identity Providers such as Facebook or Google.
This Provider supports the AWS Cognito OAuth 2.0 Flow Authorization code grant
.
Information about using Amazon Cognito User Pools can be found at http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html
- AWSSDK.CognitoIdentityProvider - used to retrieve the user claims information
- Microsoft.AspNetCore.Authentication.OAuth - This Provider is subclassed from the OAuth Provider
Once you have set up your Amazon Cognito User Pool and defined an application within the user pool, you will have the necessary information to configure this provider.
In your Startup
class ConfigureServices
method, register the Provider and configure it
services.AddAuthentication()
.AddAWSCognito(
My-AuthenticationScheme-Name,
My-Auth-DisplayName,
options =>
{
options.ClientId = "YOUR_USERPOOL_APP_CLIENT_ID";
options.ClientSecret = "YOUR_USERPOOL_APP_CLIENT_SECRET";
options.CallbackPath = "/signin-myservice"; // Your UserPool App Callback Url
options.UserPoolAppDomainPrefix = "YOUR-USERPOOL-APP-DOMAIN-PREFIX";
options.AmazonRegionEndpoint = RegionEndpoint.USEast1; // AWS Region of your Cognito User Pool
// Add Your Scopes of Interest
options.Scope.Add(AWSCognitoScopes.OpenId);
options.Scope.Add(AWSCognitoScopes.Profile);
options.Scope.Add(AWSCognitoScopes.Email);
});