Class OAuthToken

  • All Implemented Interfaces:
    java.io.Serializable, org.apache.shiro.authc.AuthenticationToken

    public class OAuthToken
    extends ExternalAuthenticationToken
    OAuth authentication token which is supported by OAuthRealm instances. This token carries information about authorization code which is required by a realm to create access tokens to query the resource server. If you want to do authorization with JdbcRealm, enable the following in web.xml: authcStrategy = org.apache.shiro.authc.pam.AtLeastOneSuccessfulStrategy securityManager.authenticator.authenticationStrategy = $authcStrategy securityManager.realms = $oauthcMyRealm, $realmBcdJdbc
    See Also:
    Serialized Form
    • Field Detail

      • authCode

        protected final java.lang.String authCode
      • clientId

        protected final java.lang.String clientId
      • redirectUrl

        protected final java.lang.String redirectUrl
    • Constructor Detail

      • OAuthToken

        public OAuthToken​(OAuthAuthenticatingFilter authenticator,
                          java.lang.String clientId,
                          java.lang.String redirectUrl,
                          java.lang.String authCode)
    • Method Detail

      • getClientId

        public java.lang.String getClientId()
      • getRedirectUrl

        public java.lang.String getRedirectUrl()
      • isCreatedBy

        public boolean isCreatedBy​(OAuthAuthenticatingFilter authenticator)
        Parameters:
        authenticator -
        Returns:
        true if this token has been created by given authenticator instance
      • getAuthCode

        public java.lang.String getAuthCode()
      • setPrincipal

        public void setPrincipal​(java.lang.Object principal)
      • getCredentials

        public java.lang.Object getCredentials()
        Specified by:
        getCredentials in interface org.apache.shiro.authc.AuthenticationToken
        Overrides:
        getCredentials in class ExternalAuthenticationToken
      • getPrincipal

        public java.lang.Object getPrincipal()
        Specified by:
        getPrincipal in interface org.apache.shiro.authc.AuthenticationToken
        Overrides:
        getPrincipal in class ExternalAuthenticationToken
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object