public class GithubSecurityRealm extends AbstractPasswordBasedSecurityRealm implements UserDetailsService
| Modifier and Type | Class and Description |
|---|---|
static class |
GithubSecurityRealm.ConverterImpl |
static class |
GithubSecurityRealm.DescriptorImpl |
SecurityRealm.SecurityComponentsExtensionPoint.LegacyInstancesAreScopedToHudsonAUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION| Constructor and Description |
|---|
GithubSecurityRealm(String githubWebUri,
String githubApiUri,
String clientID,
String clientSecret,
String oauthScopes) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsSignup() |
protected GithubOAuthUserDetails |
authenticate(String username,
String password) |
SecurityRealm.SecurityComponents |
createSecurityComponents() |
org.kohsuke.stapler.HttpResponse |
doCommenceLogin(org.kohsuke.stapler.StaplerRequest request,
String from,
String referer) |
org.kohsuke.stapler.HttpResponse |
doFinishLogin(org.kohsuke.stapler.StaplerRequest request)
This is where the user comes back to at the end of the OAuth redirect
ping-pong.
|
boolean |
equals(Object object)
Compare an object against this instance for equivalence.
|
String |
getClientID() |
Secret |
getClientSecret() |
GithubSecurityRealm.DescriptorImpl |
getDescriptor() |
String |
getGithubApiUri() |
String |
getGithubUri()
Deprecated.
use
getGithubWebUri() instead. |
String |
getGithubWebUri() |
String |
getLoginUrl() |
String |
getOauthScopes() |
protected String |
getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req,
Authentication auth) |
int |
hashCode() |
boolean |
hasScope(String scope)
Checks the security realm for a GitHub OAuth scope.
|
GroupDetails |
loadGroupByGroupname(String groupName) |
UserDetails |
loadUserByUsername(String username) |
authenticate2, loadGroupByGroupname2, loadUserByUsername2all, canLogOut, commenceSignup, commonFilters, createCliAuthenticator, createFilter, doCaptcha, doLogout, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getFrom, getGroupIdStrategy, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, setCaptchaSupport, validateCaptchaclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitfromSpring, toSpring@DataBoundConstructor public GithubSecurityRealm(String githubWebUri, String githubApiUri, String clientID, String clientSecret, String oauthScopes)
githubWebUri - The URI to the root of the web UI for GitHub or GitHub Enterprise,
including the protocol (e.g. https).githubApiUri - The URI to the root of the API for GitHub or GitHub Enterprise,
including the protocol (e.g. https).clientID - The client ID for the created OAuth Application.clientSecret - The client secret for the created GitHub OAuth Application.oauthScopes - A comma separated list of OAuth Scopes to request access to.public boolean hasScope(String scope)
scope - A scope to check for in the security realm.public String getGithubApiUri()
public String getGithubWebUri()
@Deprecated public String getGithubUri()
getGithubWebUri() instead.public String getClientID()
public Secret getClientSecret()
public String getOauthScopes()
public org.kohsuke.stapler.HttpResponse doCommenceLogin(org.kohsuke.stapler.StaplerRequest request,
@QueryParameter
String from,
@Header(value="Referer")
String referer)
throws IOException
IOExceptionpublic org.kohsuke.stapler.HttpResponse doFinishLogin(org.kohsuke.stapler.StaplerRequest request)
throws IOException
IOExceptionpublic boolean allowsSignup()
allowsSignup in class SecurityRealmpublic SecurityRealm.SecurityComponents createSecurityComponents()
createSecurityComponents in class AbstractPasswordBasedSecurityRealmprotected GithubOAuthUserDetails authenticate(String username, String password) throws AuthenticationException
authenticate in class AbstractPasswordBasedSecurityRealmAuthenticationExceptionpublic String getLoginUrl()
getLoginUrl in class SecurityRealmprotected String getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req, Authentication auth)
getPostLogOutUrl in class SecurityRealmpublic GithubSecurityRealm.DescriptorImpl getDescriptor()
getDescriptor in interface Describable<SecurityRealm>getDescriptor in class SecurityRealmpublic UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException
loadUserByUsername in interface UserDetailsServiceloadUserByUsername in class AbstractPasswordBasedSecurityRealmusername - username to lookupUsernameNotFoundExceptionDataAccessExceptionpublic boolean equals(Object object)
public GroupDetails loadGroupByGroupname(String groupName) throws UsernameNotFoundException, DataAccessException
loadGroupByGroupname in class AbstractPasswordBasedSecurityRealmgroupName - groupName to look upUsernameNotFoundExceptionDataAccessExceptionCopyright © 2016–2022. All rights reserved.