Package org.teiid.jboss.oauth
Class OAuth20LoginModule
- java.lang.Object
-
- org.jboss.security.auth.spi.AbstractServerLoginModule
-
- org.picketbox.datasource.security.AbstractPasswordCredentialLoginModule
-
- org.teiid.jboss.oauth.OAuth20LoginModule
-
- All Implemented Interfaces:
LoginModule
- Direct Known Subclasses:
JWTBearerTokenLoginModule
,SAMLBearerTokenLoginModule
public class OAuth20LoginModule extends org.picketbox.datasource.security.AbstractPasswordCredentialLoginModule
Login module to capture OAuth 2.0 profile credential for web service resource-adapter. Users either need to provide all the options or extend this login module to provide all necessary options at runtime.
-
-
Field Summary
Fields Modifier and Type Field Description protected Principal
callerPrincipal
protected Subject
callerSubject
protected OAuthCredential
credential
-
Constructor Summary
Constructors Constructor Description OAuth20LoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
commit()
String
getAccessToken()
String
getAccessTokenURI()
String
getClientId()
String
getClientSecret()
OAuthCredential
getCredential()
protected Principal
getIdentity()
String
getRefreshToken()
protected Group[]
getRoleSets()
void
initialize(Subject subject, CallbackHandler handler, Map<String,?> sharedState, Map<String,?> options)
boolean
login()
void
setAccessToken(String accessToken)
void
setAccessTokenURI(String accessTokenURI)
void
setClientId(String clientId)
void
setClientSecret(String clientSecret)
void
setCredential(OAuthCredential credential)
void
setRefreshToken(String refreshToken)
-
Methods inherited from class org.picketbox.datasource.security.AbstractPasswordCredentialLoginModule
logout, removeCredentials
-
-
-
-
Field Detail
-
credential
protected OAuthCredential credential
-
callerSubject
protected Subject callerSubject
-
callerPrincipal
protected Principal callerPrincipal
-
-
Method Detail
-
initialize
public void initialize(Subject subject, CallbackHandler handler, Map<String,?> sharedState, Map<String,?> options)
- Specified by:
initialize
in interfaceLoginModule
- Overrides:
initialize
in classorg.jboss.security.auth.spi.AbstractServerLoginModule
-
login
public boolean login() throws LoginException
- Specified by:
login
in interfaceLoginModule
- Overrides:
login
in classorg.jboss.security.auth.spi.AbstractServerLoginModule
- Throws:
LoginException
-
getIdentity
protected Principal getIdentity()
- Specified by:
getIdentity
in classorg.jboss.security.auth.spi.AbstractServerLoginModule
-
getRoleSets
protected Group[] getRoleSets() throws LoginException
- Specified by:
getRoleSets
in classorg.jboss.security.auth.spi.AbstractServerLoginModule
- Throws:
LoginException
-
commit
public boolean commit() throws LoginException
- Specified by:
commit
in interfaceLoginModule
- Overrides:
commit
in classorg.jboss.security.auth.spi.AbstractServerLoginModule
- Throws:
LoginException
-
getCredential
public OAuthCredential getCredential()
-
setCredential
public void setCredential(OAuthCredential credential)
-
getClientId
public String getClientId()
-
setClientId
public void setClientId(String clientId)
-
getClientSecret
public String getClientSecret()
-
setClientSecret
public void setClientSecret(String clientSecret)
-
getRefreshToken
public String getRefreshToken()
-
setRefreshToken
public void setRefreshToken(String refreshToken)
-
getAccessTokenURI
public String getAccessTokenURI()
-
setAccessTokenURI
public void setAccessTokenURI(String accessTokenURI)
-
getAccessToken
public String getAccessToken()
-
setAccessToken
public void setAccessToken(String accessToken)
-
-