Package org.jenkinsci.plugins
Class GithubAuthenticationToken
java.lang.Object
org.acegisecurity.providers.AbstractAuthenticationToken
org.jenkinsci.plugins.GithubAuthenticationToken
- All Implemented Interfaces:
Serializable,Principal,Authentication
- Author:
- mocleiri to hold the authentication token from the github oauth process.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGithubAuthenticationToken(String accessToken, String githubServer) GithubAuthenticationToken(String accessToken, String githubServer, boolean clearUserCache) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclearCacheForUser(String userName) Clear caches by username for use in new loginsstatic voidNecessary for testingorg.kohsuke.github.GHMyselfReturns the GHMyself object from this instance.Returns the login name in GitHub.Methods inherited from class org.acegisecurity.providers.AbstractAuthenticationToken
equals, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.acegisecurity.Authentication
toSpring
-
Field Details
-
CACHE_EXPIRY
-
-
Constructor Details
-
GithubAuthenticationToken
- Throws:
IOException
-
GithubAuthenticationToken
public GithubAuthenticationToken(String accessToken, String githubServer, boolean clearUserCache) throws IOException - Throws:
IOException
-
-
Method Details
-
clearCaches
public static void clearCaches()Necessary for testing -
clearCacheForUser
Clear caches by username for use in new logins -
getAuthorities
- Specified by:
getAuthoritiesin interfaceAuthentication- Overrides:
getAuthoritiesin classAbstractAuthenticationToken
-
getCredentials
-
getPrincipal
Returns the login name in GitHub.- Returns:
- principal
-
getMyself
Returns the GHMyself object from this instance.- Returns:
- myself
- Throws:
IOException
-