Class ResourceOwnerPasswordTokenAuthenticator
- java.lang.Object
-
- org.shakespeareframework.retrofit.oauth2.RetryingTokenAuthenticator
-
- org.shakespeareframework.retrofit.oauth2.ResourceOwnerPasswordTokenAuthenticator
-
- All Implemented Interfaces:
okhttp3.Authenticator
public class ResourceOwnerPasswordTokenAuthenticator extends RetryingTokenAuthenticator
RetryingTokenAuthenticator
to automatically authenticate with theOauth2Api
via resource owner password flow (grant typepassword
) and add the access token as a header.Also note that refresh tokens are currently ignored!
-
-
Field Summary
-
Fields inherited from class org.shakespeareframework.retrofit.oauth2.RetryingTokenAuthenticator
oauth2Api
-
-
Constructor Summary
Constructors Constructor Description ResourceOwnerPasswordTokenAuthenticator(java.lang.String tokenServiceUrl, java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String clientSecret)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Oauth2Token
getToken()
-
Methods inherited from class org.shakespeareframework.retrofit.oauth2.RetryingTokenAuthenticator
authenticate
-
-
-
-
Constructor Detail
-
ResourceOwnerPasswordTokenAuthenticator
public ResourceOwnerPasswordTokenAuthenticator(java.lang.String tokenServiceUrl, java.lang.String username, java.lang.String password, java.lang.String clientId, java.lang.String clientSecret)
- Parameters:
tokenServiceUrl
- the URl of the token service.username
- the usernamepassword
- the passwordclientId
- the client IDclientSecret
- the client secret
-
-
Method Detail
-
getToken
protected Oauth2Token getToken()
- Specified by:
getToken
in classRetryingTokenAuthenticator
-
-