GenerateNewApiKeys() public method

public GenerateNewApiKeys ( string userId ) : List
userId string
return List
        public override void OnRegistered(IRequest httpReq, IAuthSession session, IServiceBase registrationService)
        {
            var apiKeys  = apiKeyProvider.GenerateNewApiKeys(session.UserAuthId);
            var authRepo = (IManageApiKeys)httpReq.TryResolve <IAuthRepository>().AsUserAuthRepository(httpReq);

            authRepo.StoreAll(apiKeys);
        }
示例#2
0
 public override void OnRegistered(IRequest httpReq, IAuthSession session, IServiceBase registrationService)
 {
     var apiKeys = apiKeyProvider.GenerateNewApiKeys(session.UserAuthId);
     var authRepo = (IManageApiKeys)HostContext.AppHost.GetAuthRepository(httpReq);
     using (authRepo as IDisposable)
     {
         authRepo.StoreAll(apiKeys);
     }
 }
示例#3
0
        public override async Task OnRegisteredAsync(IRequest httpReq, IAuthSession session, IServiceBase registrationService,
                                                     CancellationToken token = default)
        {
            var apiKeys       = apiKeyProvider.GenerateNewApiKeys(session.UserAuthId);
            var manageApiKeys = HostContext.AppHost.AssertManageApiKeysAsync(httpReq);

            using (manageApiKeys as IDisposable)
            {
                await manageApiKeys.StoreAllAsync(apiKeys, token).ConfigAwait();
            }
        }