GithubAuthProvider
Create an App at: https://github.com/settings/applications/new The Callback URL for your app should match the CallbackUrl provided.
Assembly: ServiceStack.dll
View Source
Declaration
public class GithubAuthProvider : OAuthProvider, IAuthPlugin, IOAuthProvider, IAuthProvider
Properties
PreAuthUrl
View Source
Declaration
public string PreAuthUrl { get; set; }
VerifyAccessTokenUrl
View Source
Declaration
public string VerifyAccessTokenUrl { get; set; }
Meta
View Source
Declaration
public override Dictionary<string, string> Meta { get; }
ClientId
View Source
Declaration
public string ClientId { get; set; }
ClientSecret
View Source
Declaration
public string ClientSecret { get; set; }
Scopes
View Source
Declaration
public string[] Scopes { get; set; }
Inherited Properties
AccessTokenUrl
View Source
Declaration
public string AccessTokenUrl { get; set; }
AuthHttpGateway
View Source
Declaration
public IAuthHttpGateway AuthHttpGateway { get; set; }
AuthorizeUrl
View Source
Declaration
public string AuthorizeUrl { get; set; }
ConsumerKey
View Source
Declaration
public string ConsumerKey { get; set; }
ConsumerSecret
View Source
Declaration
public string ConsumerSecret { get; set; }
IssuerSigningKeysUrl
View Source
Declaration
public string IssuerSigningKeysUrl { get; set; }
Meta
View Source
Declaration
public override Dictionary<string, string> Meta { get; }
OAuthUtils
View Source
Declaration
public OAuthAuthorizer OAuthUtils { get; set; }
RequestTokenUrl
View Source
Declaration
public string RequestTokenUrl { get; set; }
Type
View Source
Declaration
public override string Type { get; }
UserProfileUrl
View Source
Declaration
public string UserProfileUrl { get; set; }
VerifyAccessTokenAsync
View Source
Declaration
public Func<string, AuthContext, Task<bool>> VerifyAccessTokenAsync { get; set; }
VerifyTokenUrl
View Source
Declaration
public string VerifyTokenUrl { get; set; }
Fields
Name
View Source
Declaration
public const string Name = "github"
Realm
View Source
Declaration
public static string Realm
DefaultPreAuthUrl
View Source
Declaration
public const string DefaultPreAuthUrl = "https://github.com/login/oauth/authorize"
DefaultVerifyAccessTokenUrl
View Source
Declaration
public const string DefaultVerifyAccessTokenUrl = "https://api.github.com/applications/{0}/tokens/{1}"
Methods
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
View Source
Declaration
public override async Task<object> AuthenticateAsync(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
System.Threading.CancellationToken | token |
AuthenticateWithAccessTokenAsync(IServiceBase, IAuthSession, IAuthTokens, String, CancellationToken)
View Source
Declaration
protected virtual async Task<object> AuthenticateWithAccessTokenAsync(IServiceBase authService, IAuthSession session, IAuthTokens tokens, string accessToken, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
System.String | accessToken |
System.Threading.CancellationToken | token |
LoadUserAuthInfoAsync(AuthUserSession, IAuthTokens, Dictionary<String, String>, CancellationToken)
View Source
Declaration
protected override async Task LoadUserAuthInfoAsync(AuthUserSession userSession, IAuthTokens tokens, Dictionary<string, string> authInfo, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.AuthUserSession | userSession |
ServiceStack.Auth.IAuthTokens | tokens |
System.Collections.Generic.Dictionary<System.String,System.String> | authInfo |
System.Threading.CancellationToken | token |
LoadUserOAuthProviderAsync(IAuthSession, IAuthTokens)
View Source
Declaration
public override Task LoadUserOAuthProviderAsync(IAuthSession authSession, IAuthTokens tokens)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | authSession |
ServiceStack.Auth.IAuthTokens | tokens |
Inherited Methods
AssertConsumerKey()
View Source
Declaration
protected virtual void AssertConsumerKey()
AssertConsumerSecret()
View Source
Declaration
protected virtual void AssertConsumerSecret()
AssertValidState()
View Source
Declaration
protected virtual void AssertValidState()
AuthenticateAsync(IServiceBase, IAuthSession, Authenticate, CancellationToken)
The entry point for all AuthProvider providers. Runs inside the AuthService so exceptions are treated normally. Overridable so you can provide your own Auth implementation.
View Source
Declaration
public abstract override Task<object> AuthenticateAsync(IServiceBase authService, IAuthSession session, Authenticate request, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.Object>
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
System.Threading.CancellationToken | token |
Init(IServiceBase, ref IAuthSession, Authenticate)
Sets the CallbackUrl and session.ReferrerUrl if not set and initializes the session tokens for this AuthProvider
View Source
Declaration
protected IAuthTokens Init(IServiceBase authService, ref IAuthSession session, Authenticate request)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.IServiceBase | authService |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Authenticate | request |
IsAuthorized(IAuthSession, IAuthTokens, Authenticate)
View Source
Declaration
public override bool IsAuthorized(IAuthSession session, IAuthTokens tokens, Authenticate request = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Auth.IAuthTokens | tokens |
ServiceStack.Authenticate | request |
LoadUserOAuthProviderAsync(IAuthSession, IAuthTokens)
View Source
Declaration
public virtual Task LoadUserOAuthProviderAsync(IAuthSession userSession, IAuthTokens tokens)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.Auth.IAuthSession | userSession |
ServiceStack.Auth.IAuthTokens | tokens |