Package org.forgerock.oauth2.restlet
Class DeviceCodeVerificationResource
- java.lang.Object
-
- org.restlet.resource.Resource
-
- org.restlet.resource.ServerResource
-
- org.forgerock.openam.rest.service.RouterContextResource
-
- org.forgerock.oauth2.restlet.ConsentRequiredResource
-
- org.forgerock.oauth2.restlet.DeviceCodeVerificationResource
-
public class DeviceCodeVerificationResource extends ConsentRequiredResource
A restlet resource for user codes- Since:
- 13.0.0
- See Also:
- OAuth 2.0 Protocol - Device Flow
-
-
Field Summary
-
Fields inherited from class org.forgerock.oauth2.restlet.ConsentRequiredResource
baseURLProviderFactory, xuiState
-
-
Constructor Summary
Constructors Constructor Description DeviceCodeVerificationResource(XUIState xuiState, org.restlet.routing.Router router, BaseURLProviderFactory baseURLProviderFactory, OAuth2Representation representation, TokenStore tokenStore, OAuth2RequestFactory requestFactory, AuthorizationService authorizationService, OAuth2ProviderSettingsFactory providerSettingsFactory, ExceptionHandler exceptionHandler, ResourceOwnerSessionValidator resourceOwnerSessionValidator, ClientRegistrationStore clientRegistrationStore, OAuth2Utils oAuth2Utils, CsrfProtection csrfProtection)Constructs user code verification resource for OAuth2 Device Flow
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCatch(Throwable throwable)Handles any exception that is thrown when processing a OAuth2 authorization request.org.restlet.representation.RepresentationuserCodeForm()Handles GET requests to the OAuth2 device/user endpoint, returning a form to allow the user to submit their user codeorg.restlet.representation.Representationverify(org.restlet.representation.Representation body)Handles POST requests to the OAuth2 device/user endpoint.-
Methods inherited from class org.forgerock.oauth2.restlet.ConsentRequiredResource
getDataModel
-
Methods inherited from class org.forgerock.openam.rest.service.RouterContextResource
getContext
-
Methods inherited from class org.restlet.resource.ServerResource
abort, commit, delete, delete, describeVariants, doConditionalHandle, doError, doHandle, doHandle, doHandle, doNegotiatedHandle, get, get, getAnnotation, getAnnotation, getAnnotations, getAttribute, getDescription, getInfo, getInfo, getName, getOnSent, getPreferredVariant, getRole, getVariants, getVariants, handle, hasAnnotations, head, head, isAnnotated, isAutoCommitting, isCommitted, isConditional, isExisting, isInRole, isNegotiated, options, options, patch, patch, post, post, put, put, redirectPermanent, redirectPermanent, redirectSeeOther, redirectSeeOther, redirectTemporary, redirectTemporary, setAllowedMethods, setAnnotated, setAttribute, setAutoCommitting, setChallengeRequests, setCommitted, setConditional, setCookieSettings, setDescription, setDimensions, setExisting, setLocationRef, setLocationRef, setName, setNegotiated, setOnSent, setProxyChallengeRequests, setServerInfo, setStatus, setStatus, setStatus, setStatus, updateAllowedMethods, updateDimensions
-
Methods inherited from class org.restlet.resource.Resource
doError, doInit, doRelease, getAllowedMethods, getApplication, getChallengeRequests, getChallengeResponse, getClientInfo, getConditions, getConnegService, getConverterService, getCookies, getCookieSettings, getDimensions, getHostRef, getLocationRef, getLogger, getMatrix, getMatrixValue, getMaxForwards, getMetadataService, getMethod, getOriginalRef, getProtocol, getProxyChallengeRequests, getProxyChallengeResponse, getQuery, getQueryValue, getRanges, getReference, getReferrerRef, getRequest, getRequestAttributes, getRequestCacheDirectives, getRequestEntity, getResponse, getResponseAttributes, getResponseCacheDirectives, getResponseEntity, getRootRef, getServerInfo, getStatus, getStatusService, init, isConfidential, isLoggable, release, setApplication, setQueryValue, setRequest, setResponse, toBoolean, toByte, toDouble, toFloat, toInteger, toLong, toObject, toRepresentation, toRepresentation, toRepresentation, toShort, toString
-
-
-
-
Constructor Detail
-
DeviceCodeVerificationResource
@Inject public DeviceCodeVerificationResource(XUIState xuiState, @Named("OAuth2Router") org.restlet.routing.Router router, BaseURLProviderFactory baseURLProviderFactory, OAuth2Representation representation, TokenStore tokenStore, OAuth2RequestFactory requestFactory, AuthorizationService authorizationService, OAuth2ProviderSettingsFactory providerSettingsFactory, ExceptionHandler exceptionHandler, ResourceOwnerSessionValidator resourceOwnerSessionValidator, ClientRegistrationStore clientRegistrationStore, OAuth2Utils oAuth2Utils, CsrfProtection csrfProtection)
Constructs user code verification resource for OAuth2 Device Flow- Parameters:
router- The base routerexceptionHandler-oAuth2Utils- An OAuth2Utils instance.csrfProtection- An instance of the CsrfProtection.
-
-
Method Detail
-
verify
@Post public org.restlet.representation.Representation verify(org.restlet.representation.Representation body) throws ServerException, NotFoundException, InvalidGrantException, OAuth2RestletExceptionHandles POST requests to the OAuth2 device/user endpoint.
-
userCodeForm
@Get public org.restlet.representation.Representation userCodeForm() throws OAuth2RestletException, InvalidGrantException, NotFoundException, ServerExceptionHandles GET requests to the OAuth2 device/user endpoint, returning a form to allow the user to submit their user code- Returns:
- The form to allow the user to submit their user code
- Throws:
OAuth2RestletExceptionInvalidGrantExceptionNotFoundExceptionServerException
-
doCatch
protected void doCatch(Throwable throwable)
Handles any exception that is thrown when processing a OAuth2 authorization request.- Overrides:
doCatchin classorg.restlet.resource.ServerResource- Parameters:
throwable- The throwable.
-
-