Class OauthController
- java.lang.Object
-
- io.micronaut.security.token.jwt.endpoints.OauthController
-
@Requires(property="micronaut.security.endpoints.oauth.enabled", value="true") @Controller("${micronaut.security.endpoints.oauth.path:/oauth/access_token}") @Secured("isAnonymous()") @Validated public class OauthController extends java.lang.Object
A controller that handles token refresh.- Since:
- 1.0
- Author:
- Sergio del Amo, Graeme Rocher
-
-
Field Summary
Fields Modifier and Type Field Description protected AccessRefreshTokenGenerator
accessRefreshTokenGenerator
protected TokenValidator
tokenValidator
-
Constructor Summary
Constructors Constructor Description OauthController(JwtTokenValidator tokenValidator, AccessRefreshTokenGenerator accessRefreshTokenGenerator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.reactivex.Single<io.micronaut.http.HttpResponse<AccessRefreshToken>>
index(@Valid TokenRefreshRequest tokenRefreshRequest)
-
-
-
Field Detail
-
tokenValidator
protected final TokenValidator tokenValidator
-
accessRefreshTokenGenerator
protected final AccessRefreshTokenGenerator accessRefreshTokenGenerator
-
-
Constructor Detail
-
OauthController
public OauthController(JwtTokenValidator tokenValidator, AccessRefreshTokenGenerator accessRefreshTokenGenerator)
- Parameters:
tokenValidator
- An instance ofTokenValidator
accessRefreshTokenGenerator
- An instance ofAccessRefreshTokenGenerator
-
-
Method Detail
-
index
@Consumes({"application/x-www-form-urlencoded","application/json"}) @Post public io.reactivex.Single<io.micronaut.http.HttpResponse<AccessRefreshToken>> index(@Valid @Valid TokenRefreshRequest tokenRefreshRequest)
- Parameters:
tokenRefreshRequest
- An instance ofTokenRefreshRequest
present in the request- Returns:
- An AccessRefreshToken encapsulated in the HttpResponse or a failure indicated by the HTTP status
-
-