Exemplo n.º 1
0
        private async Task <TokenResponse> CreateUserAccount(BasicAuthClaims basicAuthClaims)
        {
            //Create account in repository;
            await accountIdentityProvider.CreateUserAccount(basicAuthClaims.Email, basicAuthClaims.Password);

            //Create token
            TokenResponse response =
                accountIdentityProvider.GetIdentity(basicAuthClaims.Email, basicAuthClaims.Password);

            return(response);
        }
Exemplo n.º 2
0
        private async Task <TokenResponse> CreateUserAccount(BasicAuthClaims basicAuthClaims)
        {
            string username =
                basicAuthClaims.Email.Remove(basicAuthClaims.Email.IndexOf("@", StringComparison.Ordinal));

            //Create account in repository;
            Account account = await accountIdentityProvider
                              .CreateUserAccount(basicAuthClaims.Email, basicAuthClaims.Password, username)
                              .ConfigureAwait(false);

            // send verifier email
            await emailVerifierService
            .InstatiateVerifierMessage(account.AccountId, username, basicAuthClaims.Email)
            .ConfigureAwait(false);

            // create and return token
            return(await accountIdentityProvider.GetIdentity(account).ConfigureAwait(false));
        }