Class OauthController
java.lang.Object
io.micronaut.security.token.jwt.endpoints.OauthController
@Requires(property="micronaut.security.endpoints.oauth.enabled",notEquals="false") @Requires(beans=RefreshTokenPersistence.class) @Requires(beans=RefreshTokenValidator.class)
@Controller("${micronaut.security.endpoints.oauth.path:/oauth/access_token}")
@Secured("isAnonymous()")
@Validated
public class OauthController
extends Object
A controller that handles token refresh.
- Since:
- 1.0
- Author:
- Sergio del Amo, Graeme Rocher
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOauthController
(RefreshTokenPersistence refreshTokenPersistence, RefreshTokenValidator refreshTokenValidator, OauthControllerConfigurationProperties oauthControllerConfigurationProperties, LoginHandler loginHandler) -
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>>
org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>>
-
Constructor Details
-
OauthController
public OauthController(RefreshTokenPersistence refreshTokenPersistence, RefreshTokenValidator refreshTokenValidator, OauthControllerConfigurationProperties oauthControllerConfigurationProperties, LoginHandler loginHandler) - Parameters:
refreshTokenPersistence
- The persistence mechanism for the refresh tokenrefreshTokenValidator
- The refresh token validatoroauthControllerConfigurationProperties
- The controller configurationloginHandler
- The login handler
-
-
Method Details
-
index
@Consumes({"application/x-www-form-urlencoded","application/json"}) @Post @SingleResult public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> index(io.micronaut.http.HttpRequest<?> request, @Nullable @Body Map<String, String> body, @Nullable @CookieValue("JWT_REFRESH_TOKEN") String cookieRefreshToken) - Parameters:
request
- The current requestbody
- HTTP Request body which will be mapped to aTokenRefreshRequest
.cookieRefreshToken
- The refresh token stored in a cookie- Returns:
- A response or a failure indicated by the HTTP status
-
index
@Get @SingleResult public org.reactivestreams.Publisher<io.micronaut.http.MutableHttpResponse<?>> index(io.micronaut.http.HttpRequest<?> request, @Nullable @CookieValue("JWT_REFRESH_TOKEN") String cookieRefreshToken) - Parameters:
request
- The current requestcookieRefreshToken
- The refresh token stored in a cookie- Returns:
- A response or a failure indicated by the HTTP status
-