Class OAuthSession

    • Constructor Detail

      • OAuthSession

        public OAuthSession​(com.google.api.client.auth.oauth2.AuthorizationCodeFlow flow,
                            String from,
                            String redirectUrl)
    • 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 the OAuthSession associated with HTTP session in the current extend.