// Replace local IP with localhost if the server does not accept IP private static string AdjustRedirectUrl(string url, OAuthServerOptions serverOptions) { if (serverOptions.IsSet(OAuthServerOptions.TokenReplaceLocalIpWithLocalHost)) { return(url.Replace("127.0.0.1", "localhost")); } else { return(url); } }
public static IOAuthRemoteServer CreateOrUpdateServer(IEntitySession session, string name, OAuthServerOptions options, string siteUrl, string authorizationUrl, string tokenRequestUrl, string tokenRefreshUrl, string scopes, string documentationUrl, string basicProfileUrl, string profileUserIdTag) { IOAuthRemoteServer srv = session.EntitySet<IOAuthRemoteServer>().Where(s => s.Name == name).FirstOrDefault(); if(srv == null) srv = session.NewEntity<IOAuthRemoteServer>(); srv.Name = name; srv.Options = options; srv.SiteUrl = siteUrl; srv.AuthorizationUrl = authorizationUrl; srv.TokenRequestUrl = tokenRequestUrl; srv.TokenRefreshUrl = tokenRefreshUrl; srv.Scopes = scopes; srv.DocumentationUrl = documentationUrl; srv.BasicProfileUrl = basicProfileUrl; srv.ProfileUserIdTag = profileUserIdTag; return srv; }
public static IOAuthRemoteServer NewOAuthRemoteServer(this IEntitySession session, string name, OAuthServerOptions options, string siteUrl, string authorizationUrl, string tokenRequestUrl, string tokenRefreshUrl, string documentationUrl, string basicProfileUrl, string profileUserIdTag, string tokenRevokeUrl = null) { var srv = session.NewEntity <IOAuthRemoteServer>(); srv.Name = name; srv.Options = options; srv.SiteUrl = siteUrl; srv.AuthorizationUrl = authorizationUrl; srv.TokenRequestUrl = tokenRequestUrl; srv.TokenRefreshUrl = tokenRefreshUrl; srv.DocumentationUrl = documentationUrl; srv.BasicProfileUrl = basicProfileUrl; srv.ProfileUserIdTag = profileUserIdTag; srv.TokenRevokeUrl = tokenRevokeUrl; return(srv); }
public static bool IsSet(this OAuthServerOptions options, OAuthServerOptions option) { return((options & option) != 0); }
public static bool IsSet(this OAuthServerOptions options, OAuthServerOptions option) { return (options & option) != 0; }
public static IOAuthRemoteServer NewOAuthRemoteServer(this IEntitySession session, string name, OAuthServerOptions options, string siteUrl, string authorizationUrl, string tokenRequestUrl, string tokenRefreshUrl, string documentationUrl, string basicProfileUrl, string profileUserIdTag) { var srv = session.NewEntity<IOAuthRemoteServer>(); srv.Name = name; srv.Options = options; srv.SiteUrl = siteUrl; srv.AuthorizationUrl = authorizationUrl; srv.TokenRequestUrl = tokenRequestUrl; srv.TokenRefreshUrl = tokenRefreshUrl; srv.DocumentationUrl = documentationUrl; srv.BasicProfileUrl = basicProfileUrl; srv.ProfileUserIdTag = profileUserIdTag; return srv; }
public static IOAuthRemoteServer CreateOrUpdateServer(IEntitySession session, string name, OAuthServerOptions options, string siteUrl, string authorizationUrl, string tokenRequestUrl, string tokenRefreshUrl, string tokenRevokeUrl, string scopes, string documentationUrl, string basicProfileUrl, string profileUserIdTag) { IOAuthRemoteServer srv = session.EntitySet <IOAuthRemoteServer>().Where(s => s.Name == name).FirstOrDefault(); if (srv == null) { srv = session.NewEntity <IOAuthRemoteServer>(); } srv.Name = name; srv.Options = options; srv.SiteUrl = siteUrl; srv.AuthorizationUrl = authorizationUrl; srv.TokenRequestUrl = tokenRequestUrl; srv.TokenRefreshUrl = tokenRefreshUrl; srv.TokenRevokeUrl = tokenRevokeUrl; srv.Scopes = scopes; srv.DocumentationUrl = documentationUrl; srv.BasicProfileUrl = basicProfileUrl; srv.ProfileUserIdTag = profileUserIdTag; return(srv); }