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