public async Task <IdentityResult> Create(CredentialsModelBL credentials) { var userIdentity = mapper.Map <ApplicationUser>(credentials); var identityResult = await userManager.CreateAsync(userIdentity, credentials.Password); return(identityResult); }
public async Task <string> GetJwtForCredentials(CredentialsModelBL credentials) { var identity = await GetClaimsIdentity(credentials.Username, credentials.Password); if (identity == null) { return(null); } return(await Tokens.GenerateJwt( identity, jwtFactory, credentials.Username, jwtOptions, new JsonSerializerSettings { Formatting = Formatting.Indented } )); }