public static TokenValidator CreateTokenValidator(ITokenHandleStore tokenStore = null, IUserService users = null) { if (users == null) { users = new TestUserService(); } var clients = CreateClientStore(); var options = TestIdentityServerOptions.Create(); options.Factory = new IdentityServerServiceFactory(); var context = CreateOwinContext(options, clients, users); var defaultSigningKeyService = new DefaultSigningKeyService(options); var validator = new TokenValidator( options: options, clients: clients, tokenHandles: tokenStore, customValidator: new DefaultCustomTokenValidator( users: users, clients: clients), owinEnvironment: new OwinEnvironmentService(context), keyService: defaultSigningKeyService, certificateKeyService: defaultSigningKeyService); return(validator); }
public static DefaultTokenSigningService CreateDefaultTokenSigningService() { var defaultSigningKeyService = new DefaultSigningKeyService(TestIdentityServerOptions.Create()); return(new DefaultTokenSigningService(defaultSigningKeyService, defaultSigningKeyService)); }