Class OAuthSession
- java.lang.Object
-
- org.openshift.jenkins.plugins.openshiftlogin.OAuthSession
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BearerTokenOAuthSession
public abstract class OAuthSession extends Object implements Serializable
The state of the OAuth request. Verifies the validity of the response by comparing the state.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description OAuthSession(com.google.api.client.auth.oauth2.AuthorizationCodeFlow flow, String from, String redirectUrl)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponse
doCommenceLogin()
Starts the login session.org.kohsuke.stapler.HttpResponse
doFinishLogin(org.kohsuke.stapler.StaplerRequest request)
When the identity provider is done with its thing, the user comes back here.protected org.kohsuke.stapler.HttpResponse
doRequestAuthorizationCode()
com.google.api.client.auth.oauth2.Credential
getCredential()
static OAuthSession
getCurrent()
Gets theOAuthSession
associated with HTTP session in the current extend.protected String
getFrom()
Where was the user trying to navigate to when they had to login?protected abstract org.kohsuke.stapler.HttpResponse
onSuccess(String authorizationCode)
void
setCredential(com.google.api.client.auth.oauth2.Credential cred)
-
-
-
Method Detail
-
getCredential
public com.google.api.client.auth.oauth2.Credential getCredential()
-
setCredential
public void setCredential(com.google.api.client.auth.oauth2.Credential cred)
-
doCommenceLogin
public org.kohsuke.stapler.HttpResponse doCommenceLogin() throws IOException
Starts the login session.- Throws:
IOException
-
doRequestAuthorizationCode
protected org.kohsuke.stapler.HttpResponse doRequestAuthorizationCode()
-
doFinishLogin
public org.kohsuke.stapler.HttpResponse doFinishLogin(org.kohsuke.stapler.StaplerRequest request) throws IOException
When the identity provider is done with its thing, the user comes back here.- Throws:
IOException
-
getFrom
protected String getFrom()
Where was the user trying to navigate to when they had to login?- Returns:
- the url the user wants to reach
-
onSuccess
protected abstract org.kohsuke.stapler.HttpResponse onSuccess(String authorizationCode) throws IOException
- Throws:
IOException
-
getCurrent
public static OAuthSession getCurrent()
Gets theOAuthSession
associated with HTTP session in the current extend.
-
-