public class OpenShiftOAuth2SecurityRealm extends SecurityRealm implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
OpenShiftOAuth2SecurityRealm.DescriptorImpl |
SecurityRealm.SecurityComponentsExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SVC_ACCT_DIR |
static String |
OAUTH_ACCESS_TOKEN_NAME |
static String |
SECURITY_REALM_FINISH_LOGIN |
AUTHENTICATED_AUTHORITY, AUTHENTICATED_AUTHORITY2, LIST, NO_AUTHENTICATION| Constructor and Description |
|---|
OpenShiftOAuth2SecurityRealm(String serviceAccountDirectory,
String serviceAccountName,
String serverPrefix,
String clientId,
String clientSecret,
String redirectURL) |
| Modifier and Type | Method and Description |
|---|---|
String |
buildOAuthRedirectUrl(String redirect) |
SecurityRealm.SecurityComponents |
createSecurityComponents()
Acegi has this notion that first an
Authentication
object is created by collecting user information and then the act of
authentication is done later (by
AuthenticationManager) to verify it. |
protected void |
deleteOauthAccessToken(String oAuthAccessToken) |
org.kohsuke.stapler.HttpResponse |
doCommenceLogin(String from,
String referer)
The login process starts from here.
|
org.kohsuke.stapler.HttpResponse |
doFinishLogin(org.kohsuke.stapler.StaplerRequest request)
This is where the user comes back to at the end of the OpenID redirect
ping-pong.
|
void |
doLogout(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse resp) |
String |
getClientId() |
Secret |
getClientSecret() |
String |
getDefaultedClientId() |
Secret |
getDefaultedClientSecret() |
String |
getDefaultedNamespace() |
String |
getDefaultedRedirectURL() |
String |
getDefaultedServerPrefix() |
String |
getDefaultedServiceAccountDirectory() |
String |
getDefaultedServiceAccountName() |
String |
getLoginUrl()
Login begins with our
doCommenceLogin(String,String) method. |
protected String |
getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req,
Authentication auth) |
String |
getRedirectURL() |
String |
getServerPrefix() |
String |
getServiceAccountDirectory() |
String |
getServiceAccountName() |
org.kohsuke.stapler.HttpResponse |
loggedOut(String from,
String referer)
the method pointed by LOGGED_OUT.
|
protected OAuthSession |
newOAuthSession(String from,
String redirectOnFinish) |
static String |
tokenToObjectName(String code) |
UsernamePasswordAuthenticationToken |
updateAuthorizationStrategy(com.google.api.client.auth.oauth2.Credential credential) |
all, allowsSignup, canLogOut, commenceSignup, commonFilters, createCliAuthenticator, createFilter, doCaptcha, getAuthenticationGatewayUrl, getCaptchaSupport, getCaptchaSupportDescriptors, getDescriptor, getFrom, getGroupIdStrategy, getPostLogOutUrl2, getSecurityComponents, getUserIdStrategy, loadGroupByGroupname, loadGroupByGroupname, loadGroupByGroupname2, loadUserByUsername, loadUserByUsername2, setCaptchaSupport, validateCaptchapublic static final String OAUTH_ACCESS_TOKEN_NAME
public static final String SECURITY_REALM_FINISH_LOGIN
public static final String DEFAULT_SVC_ACCT_DIR
@DataBoundConstructor public OpenShiftOAuth2SecurityRealm(String serviceAccountDirectory, String serviceAccountName, String serverPrefix, String clientId, String clientSecret, String redirectURL) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic String getServiceAccountDirectory()
public String getDefaultedServiceAccountDirectory()
public String getServiceAccountName()
public String getDefaultedServiceAccountName()
public String getServerPrefix()
public String getDefaultedServerPrefix()
public String getRedirectURL()
public String getDefaultedRedirectURL()
public String getClientId()
public String getDefaultedClientId()
public Secret getClientSecret()
public Secret getDefaultedClientSecret()
public String getDefaultedNamespace()
public String getLoginUrl()
doCommenceLogin(String,String) method.getLoginUrl in class SecurityRealmpublic SecurityRealm.SecurityComponents createSecurityComponents()
Authentication
object is created by collecting user information and then the act of
authentication is done later (by
AuthenticationManager) to verify it. But in case of
OpenID, we create an Authentication only after we
verified the user identity, so
AuthenticationManager becomes no-op.createSecurityComponents in class SecurityRealmprotected OAuthSession newOAuthSession(String from, String redirectOnFinish) throws MalformedURLException
MalformedURLExceptionpublic UsernamePasswordAuthenticationToken updateAuthorizationStrategy(com.google.api.client.auth.oauth2.Credential credential) throws IOException, GeneralSecurityException
IOExceptionGeneralSecurityExceptionpublic org.kohsuke.stapler.HttpResponse loggedOut(@QueryParameter
String from,
@Header(value="Referer")
String referer)
public org.kohsuke.stapler.HttpResponse doCommenceLogin(@QueryParameter
String from,
@Header(value="Referer")
String referer)
throws IOException
IOExceptionpublic String buildOAuthRedirectUrl(String redirect) throws MalformedURLException
MalformedURLExceptionpublic org.kohsuke.stapler.HttpResponse doFinishLogin(org.kohsuke.stapler.StaplerRequest request)
throws IOException
IOExceptionpublic void doLogout(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse resp)
throws IOException,
javax.servlet.ServletException
doLogout in class SecurityRealmIOExceptionjavax.servlet.ServletExceptionprotected String getPostLogOutUrl(org.kohsuke.stapler.StaplerRequest req, Authentication auth)
getPostLogOutUrl in class SecurityRealmpublic static String tokenToObjectName(String code)
code - protected void deleteOauthAccessToken(String oAuthAccessToken)
Copyright © 2016–2022. All rights reserved.