コード例 #1
0
        public async Task <IActionResult> Password(PasswordTemplate passwordTemplate)
        {
            JwtAdto jwt = await _authenticationApplicationService.PasswordAsync(new PasswordAdto
            {
                Identifier = passwordTemplate.Identifier,
                Password   = passwordTemplate.Password
            });

            return(Ok(_resourceBuilder.Build(new SessionResource
            {
                Id = jwt.SessionId,
                AuthToken = jwt.AuthToken,
                ExpiresIn = jwt.ExpiresIn
            })));
        }
コード例 #2
0
 public Task <JwtAdto> PasswordAsync(PasswordAdto passwordAdto)
 {
     return(_securityApplicationService.SecureAsync(() => _authenticationApplicationService.PasswordAsync(passwordAdto),
                                                    DefaultAuthorisationContext.Create(AuthorisationResource.Authenticate, AuthorisationAction.Create)));
 }