@Requires(property="micronaut.security.endpoints.oauth.enabled",notEquals="false") @Requires(beans=RefreshTokenPersistence.class) @Requires(beans=RefreshTokenValidator.class) @Controller(value="${micronaut.security.endpoints.oauth.path:/oauth/access_token}") @Secured(value="isAnonymous()") @Validated public class OauthController extends java.lang.Object
Constructor and Description |
---|
OauthController(RefreshTokenPersistence refreshTokenPersistence,
RefreshTokenValidator refreshTokenValidator,
OauthControllerConfigurationProperties oauthControllerConfigurationProperties,
LoginHandler loginHandler) |
Modifier and Type | Method and Description |
---|---|
io.reactivex.Single<io.micronaut.http.MutableHttpResponse<?>> |
index(io.micronaut.http.HttpRequest<?> request,
java.lang.String cookieRefreshToken) |
io.reactivex.Single<io.micronaut.http.MutableHttpResponse<?>> |
index(io.micronaut.http.HttpRequest<?> request,
TokenRefreshRequest tokenRefreshRequest,
java.lang.String cookieRefreshToken) |
public OauthController(RefreshTokenPersistence refreshTokenPersistence, RefreshTokenValidator refreshTokenValidator, OauthControllerConfigurationProperties oauthControllerConfigurationProperties, LoginHandler loginHandler)
refreshTokenPersistence
- The persistence mechanism for the refresh tokenrefreshTokenValidator
- The refresh token validatoroauthControllerConfigurationProperties
- The controller configurationloginHandler
- The login handler@Consumes(value={"application/x-www-form-urlencoded","application/json"}) @Post public io.reactivex.Single<io.micronaut.http.MutableHttpResponse<?>> index(io.micronaut.http.HttpRequest<?> request, @Nullable @Body TokenRefreshRequest tokenRefreshRequest, @Nullable @CookieValue(value="JWT_REFRESH_TOKEN") java.lang.String cookieRefreshToken)
request
- The current requesttokenRefreshRequest
- An instance of TokenRefreshRequest
present in the requestcookieRefreshToken
- The refresh token stored in a cookie@Get public io.reactivex.Single<io.micronaut.http.MutableHttpResponse<?>> index(io.micronaut.http.HttpRequest<?> request, @Nullable @CookieValue(value="JWT_REFRESH_TOKEN") java.lang.String cookieRefreshToken)
request
- The current requestcookieRefreshToken
- The refresh token stored in a cookie