Skip to content

Commit

Permalink
Add prompt=consent when requesting offline_access
Browse files Browse the repository at this point in the history
  • Loading branch information
phavekes committed Nov 5, 2024
1 parent ff4e4f2 commit d258422
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/generiek/api/EnrollmentEndpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ private String buildAuthorizationURI(EnrollmentRequest enrollmentRequest) throws
params.put("response_type", "code");
params.put("redirect_uri", redirectUri);
params.put("state", base64Enrollment);
//When working outside of Openconnext, the 'offline_access' is added for refresh tokens,
// and 'prompt=consent' should be added
if (enrollmentRequest.getScope().contains("offline_access")) {
params.put("prompt", "consent");
}

UriComponentsBuilder builder = UriComponentsBuilder.fromUri(authorizationUri);
params.forEach(builder::queryParam);
Expand Down

0 comments on commit d258422

Please sign in to comment.