public ApplicationApplicationManager(
     IOpenIddictApplicationStore <DynamoIdentityApplication> store,
     ILogger <OpenIddictApplicationManager <DynamoIdentityApplication> > logger)
     : base(store, logger)
 {
     _store = store as DynamoApplicationStore <DynamoIdentityApplication, DynamoIdentityToken>;
 }
Exemple #2
0
        private async Task CreateClientAsync(
            DynamoApplicationStore <DynamoIdentityApplication, DynamoIdentityToken> applicationsStore,
            string clientId, string clientSecret, string url)
        {
            var clientApp = applicationsStore.FindByClientIdAsync(clientId, default(CancellationToken)).Result;

            if (clientApp == null)
            {
                clientApp = new DynamoIdentityApplication
                {
                    ClientId          = clientId,
                    DisplayName       = "My client application",
                    RedirectUri       = url + "/signin-oidc",
                    LogoutRedirectUri = url + "/signout-callback-oidc",
                    ClientSecret      = Crypto.HashPassword(clientSecret),
                    Type = clientSecret == null
                        ? OpenIddictConstants.ClientTypes.Public
                        : OpenIddictConstants.ClientTypes.Confidential
                };

                await applicationsStore.CreateAsync(clientApp, default(CancellationToken));
            }
        }