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:
  • Constructor Details

    • OAuthSession

      public OAuthSession(com.google.api.client.auth.oauth2.AuthorizationCodeFlow flow, String from, String redirectUrl)
  • Method Details

    • 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 the OAuthSession associated with HTTP session in the current extend.