Nonce parameter should be required in authorizationEndpoint only when "id_token" is included in response_type
Closes #10143
This commit is contained in:
parent
6801688dd4
commit
92f6c75328
3 changed files with 5 additions and 2 deletions
|
@ -227,7 +227,7 @@ public class AuthorizationEndpointChecker {
|
|||
return;
|
||||
}
|
||||
|
||||
if (parsedResponseType.isImplicitOrHybridFlow() && request.getNonce() == null) {
|
||||
if (parsedResponseType.hasResponseType(OIDCResponseType.ID_TOKEN) && request.getNonce() == null) {
|
||||
ServicesLogger.LOGGER.missingParameter(OIDCLoginProtocol.NONCE_PARAM);
|
||||
event.error(Errors.INVALID_REQUEST);
|
||||
throw new AuthorizationCheckException(Response.Status.BAD_REQUEST, OAuthErrorException.INVALID_REQUEST, "Missing parameter: nonce");
|
||||
|
|
|
@ -131,6 +131,9 @@ public abstract class AbstractOIDCResponseTypeTest extends AbstractTestRealmKeyc
|
|||
events.expectLogin().error(Errors.INVALID_REQUEST).user((String) null).session((String) null).clearDetails().assertEvent();
|
||||
}
|
||||
|
||||
protected void validateNonceNotUsedSuccessExpected() {
|
||||
loginUser(null);
|
||||
}
|
||||
|
||||
protected void validateNonceNotUsedErrorExpected() {
|
||||
oauth.nonce(null);
|
||||
|
|
|
@ -76,7 +76,7 @@ public class OIDCHybridResponseTypeCodeTokenTest extends AbstractOIDCResponseTyp
|
|||
|
||||
@Test
|
||||
public void nonceNotUsedErrorExpected() {
|
||||
super.validateNonceNotUsedErrorExpected();
|
||||
super.validateNonceNotUsedSuccessExpected();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in a new issue