public OAuthContext(string realm, OAuthOptions options) { Realm = realm; // Store options Options = options; // Create services Services = new OAuthServicesContext( options.UserService, options.ClientStore, options.RefreshTokenStore, new JwtTokenService(options.SymmetricKey)); }
public static void ConfigureEndpoint(string realm, string path, OAuthOptions options) { if (!_contexts.ContainsKey(realm)) { if (_contexts.TryAdd(realm, new OAuthContext(realm, options))) { GlobalConfiguration.Configuration.Routes.MapHttpRoute( "OAuth_" + realm, path.TrimStart('~', '/'), new { controller = "OAuth", action = "Token", realm }); return; } } throw new Exception($"An endpoint for the realm \"{realm}\" has already been configured."); }
public static void ConfigureEndpoint(string path, OAuthOptions config) { ConfigureEndpoint(DefaultRealm, path, config); }
public static void ConfigureEndpoint(OAuthOptions config) { ConfigureEndpoint(DefaultRealm, DefaultEndpointPath, config); }