Search in sources :

Example 1 with VERIFICATION_URI

use of io.jans.as.model.authorize.DeviceAuthorizationResponseParam.VERIFICATION_URI in project jans by JanssenProject.

the class DeviceAuthorizationRestWebServiceImpl method getResponseJSONObject.

private JSONObject getResponseJSONObject(DeviceAuthorizationCacheControl deviceAuthorizationCacheControl) throws JSONException {
    URI verificationUriComplete = UriBuilder.fromUri(deviceAuthorizationCacheControl.getVerificationUri()).queryParam(DeviceAuthorizationResponseParam.USER_CODE, deviceAuthorizationCacheControl.getUserCode()).build();
    JSONObject responseJsonObject = new JSONObject();
    responseJsonObject.put(DEVICE_CODE, deviceAuthorizationCacheControl.getDeviceCode());
    responseJsonObject.put(USER_CODE, deviceAuthorizationCacheControl.getUserCode());
    responseJsonObject.put(VERIFICATION_URI, deviceAuthorizationCacheControl.getVerificationUri());
    responseJsonObject.put(VERIFICATION_URI_COMPLETE, verificationUriComplete.toString());
    responseJsonObject.put(EXPIRES_IN, deviceAuthorizationCacheControl.getExpiresIn());
    responseJsonObject.put(INTERVAL, deviceAuthorizationCacheControl.getInterval());
    return responseJsonObject;
}
Also used : JSONObject(org.json.JSONObject) URI(java.net.URI) VERIFICATION_URI(io.jans.as.model.authorize.DeviceAuthorizationResponseParam.VERIFICATION_URI)

Aggregations

VERIFICATION_URI (io.jans.as.model.authorize.DeviceAuthorizationResponseParam.VERIFICATION_URI)1 URI (java.net.URI)1 JSONObject (org.json.JSONObject)1