Package org.jenkinsci.plugins
Class GithubAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
org.jenkinsci.plugins.GithubAuthenticationToken
- All Implemented Interfaces:
Serializable
,Principal
,org.springframework.security.core.Authentication
,org.springframework.security.core.CredentialsContainer
public class GithubAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
- 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 void
clearCacheForUser
(String userName) Clear caches by username for use in new loginsstatic void
Necessary for testingCollection<org.springframework.security.core.GrantedAuthority>
org.kohsuke.github.GHMyself
Returns the GHMyself object from this instance.Returns the login name in GitHub.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
equals, eraseCredentials, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
-
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:
getAuthorities
in interfaceorg.springframework.security.core.Authentication
- Overrides:
getAuthorities
in classorg.springframework.security.authentication.AbstractAuthenticationToken
-
getCredentials
-
getPrincipal
Returns the login name in GitHub.- Returns:
- principal
-
getMyself
Returns the GHMyself object from this instance.- Returns:
- myself
- Throws:
IOException
-