Skip to content

Commit

Permalink
feat(jans-auth-server): update first party native authn implementatio…
Browse files Browse the repository at this point in the history
…n ( in backwards compatibility way) #10380

#10380
Signed-off-by: YuriyZ <[email protected]>
  • Loading branch information
yuriyz committed Dec 17, 2024
1 parent 4e7c13b commit 87bb155
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.jans.as.server.authorize.ws.rs;

import io.jans.as.model.util.QueryStringDecoder;
import io.jans.as.server.auth.DpopService;
import io.jans.as.server.service.RequestParameterService;
import jakarta.inject.Inject;
import jakarta.servlet.http.HttpServletRequest;
Expand Down Expand Up @@ -38,6 +39,8 @@ public Response requestAuthorizationPost(
@FormParam("acr_values") String acrValues,
@FormParam("auth_session") String authorizationChallengeSession,
@FormParam("use_auth_session") String useAuthorizationChallengeSession,
@FormParam("device_session") String deviceSession, // old name in draft 00
@FormParam("use_device_session") String useDeviceSession, // old name in draft 00
@FormParam("prompt") String prompt,
@FormParam("state") String state,
@FormParam("nonce") String nonce,
Expand All @@ -63,6 +66,15 @@ public Response requestAuthorizationPost(
authzRequest.setCodeChallenge(codeChallenge);
authzRequest.setCodeChallengeMethod(codeChallengeMethod);
authzRequest.setAuthzDetailsString(authorizationDetails);
authzRequest.setDpop(httpRequest.getHeader(DpopService.DPOP));

// backwards compatibilty: device_session (up to draft 02) vs auth_session (draft 02 and later)
if (authorizationChallengeSession == null && deviceSession != null) {
authzRequest.setAuthorizationChallengeSession(deviceSession);
}
if (useAuthorizationChallengeSession == null && useDeviceSession != null) {
authzRequest.setUseAuthorizationChallengeSession(Boolean.parseBoolean(useDeviceSession));
}

return authorizationChallengeService.requestAuthorization(authzRequest);
}
Expand Down

0 comments on commit 87bb155

Please sign in to comment.