Class DeviceVerificationController
java.lang.Object
com.irurueta.authserver.authorization.api.web.implicit.DeviceVerificationController
- All Implemented Interfaces:
DeviceVerificationPageApi
@Controller
public class DeviceVerificationController
extends Object
implements DeviceVerificationPageApi
Serves the device verification page, as the contract
apis/auth-server/web-pages/auth-server-pages-v1.yaml
describes it through the generated DeviceVerificationPageApi: the form where the user types the code the
device shows. The form posts to the framework's own endpoint (POST /oauth2/device_verification); a request
that already carries a code never reaches this controller, because that endpoint answers it. The page is also where
the endpoint sends the browser back to, with ?error when the attempt failed and ?success when the
device was approved.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final StringName of the model attribute that tells whether the previous attempt failed.private final PageRendererRenders the page.private static final PatternShape of a user code worth prefilling: letters, digits and dashes.(package private) static final StringName of the model attribute that tells whether the device was just approved.static final StringName of the parameter that tells the page that the device was just approved.(package private) static final StringName of the model attribute that holds the code to prefill.static final StringPath of the page, and of the verification endpoint, taken from the contract.(package private) static final StringName of the template of the page.Fields inherited from interface com.irurueta.authserver.authorization.api.web.pages.v1.generated.api.DeviceVerificationPageApi
PATH_DEVICE_VERIFICATION_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String> deviceVerificationPage(String userCode, String error, String success) Renders the device verification page.
-
Field Details
-
VERIFICATION_PATH
Path of the page, and of the verification endpoint, taken from the contract.- See Also:
-
SUCCESS_PARAMETER
Name of the parameter that tells the page that the device was just approved.- See Also:
-
VIEW_NAME
Name of the template of the page.- See Also:
-
USER_CODE_ATTRIBUTE
Name of the model attribute that holds the code to prefill.- See Also:
-
ERROR_ATTRIBUTE
Name of the model attribute that tells whether the previous attempt failed.- See Also:
-
SUCCESS_ATTRIBUTE
Name of the model attribute that tells whether the device was just approved.- See Also:
-
PLAUSIBLE_CODE
Shape of a user code worth prefilling: letters, digits and dashes. -
pageRenderer
Renders the page.
-
-
Constructor Details
-
DeviceVerificationController
public DeviceVerificationController()
-
-
Method Details
-
deviceVerificationPage
public org.springframework.http.ResponseEntity<String> deviceVerificationPage(String userCode, String error, String success) Renders the device verification page.- Specified by:
deviceVerificationPagein interfaceDeviceVerificationPageApi- Parameters:
userCode- a code to prefill, ignored unless it looks like a user code.error- present when the previous attempt failed.success- present when the device was just approved.- Returns:
- the page.
-