Package org.nuxeo.client.spi.auth
Class OAuth2AuthInterceptor
- java.lang.Object
-
- org.nuxeo.client.spi.auth.OAuth2AuthInterceptor
-
- All Implemented Interfaces:
okhttp3.Interceptor
public class OAuth2AuthInterceptor extends java.lang.Object implements okhttp3.Interceptor- Since:
- 3.3
-
-
Field Summary
Fields Modifier and Type Field Description protected OAuth2ClientoAuth2Clientprotected OAuth2Tokentoken
-
Constructor Summary
Constructors Modifier Constructor Description protectedOAuth2AuthInterceptor(OAuth2Token token, OAuth2Client oAuth2Client)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description okhttp3.Responseintercept(okhttp3.Interceptor.Chain chain)protected booleanneedToRefresh()static OAuth2AuthInterceptorobtainAuthFromAuthorizationCode(java.lang.String baseUrl, java.lang.String clientId, java.lang.String code)static OAuth2AuthInterceptorobtainAuthFromAuthorizationCode(java.lang.String baseUrl, java.lang.String clientId, java.lang.String clientSecret, java.lang.String code)static OAuth2AuthInterceptorobtainAuthFromJWTToken(java.lang.String baseUrl, java.lang.String clientId, java.lang.String jwtToken)static OAuth2AuthInterceptorobtainAuthFromJWTToken(java.lang.String baseUrl, java.lang.String clientId, java.lang.String clientSecret, java.lang.String jwtToken)
-
-
-
Field Detail
-
token
protected OAuth2Token token
-
oAuth2Client
protected OAuth2Client oAuth2Client
-
-
Constructor Detail
-
OAuth2AuthInterceptor
protected OAuth2AuthInterceptor(OAuth2Token token, OAuth2Client oAuth2Client)
-
-
Method Detail
-
intercept
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain) throws java.io.IOException- Specified by:
interceptin interfaceokhttp3.Interceptor- Throws:
java.io.IOException
-
needToRefresh
protected boolean needToRefresh()
-
obtainAuthFromAuthorizationCode
public static OAuth2AuthInterceptor obtainAuthFromAuthorizationCode(java.lang.String baseUrl, java.lang.String clientId, java.lang.String code)
-
obtainAuthFromAuthorizationCode
public static OAuth2AuthInterceptor obtainAuthFromAuthorizationCode(java.lang.String baseUrl, java.lang.String clientId, java.lang.String clientSecret, java.lang.String code)
-
obtainAuthFromJWTToken
public static OAuth2AuthInterceptor obtainAuthFromJWTToken(java.lang.String baseUrl, java.lang.String clientId, java.lang.String jwtToken)
-
obtainAuthFromJWTToken
public static OAuth2AuthInterceptor obtainAuthFromJWTToken(java.lang.String baseUrl, java.lang.String clientId, java.lang.String clientSecret, java.lang.String jwtToken)
-
-