if(!scopes.contains(OPENID))returnbadRequest(ex,"This is an OpenID Provider. You should request \"openid\" scope!");
if(!scopes.contains(OPENID))returnauthorizationError(ex,INVALID_SCOPE,"This is an OpenID Provider. You should request \"openid\" scope!",state);
varresponseTypes=toList(json,RESPONSE_TYPE);
for(varresponseType:responseTypes){
switch(responseType){
caseID_TOKEN:
caseTOKEN:
returnsendContent(ex,HTTP_NOT_IMPLEMENTED,"Response type \"%s\" currently not supported".formatted(responseType));
returnauthorizationError(ex,REQUEST_NOT_SUPPORTED,"Response type \"%s\" currently not supported".formatted(responseType),state);
caseCODE:
break;
default:
returnbadRequest(ex,"Unknown response type \"%s\"".formatted(responseType));
returnauthorizationError(ex,INVALID_REQUEST_OBJECT,"Unknown response type \"%s\"".formatted(responseType),state);
}
}
if(!responseTypes.contains(CODE))returnbadRequest(ex,"Sorry, at the moment I can only handle \"%s\" response type".formatted(CODE));
if(!responseTypes.contains(CODE))returnauthorizationError(ex,REQUEST_NOT_SUPPORTED,"Sorry, at the moment I can only handle \"%s\" response type".formatted(CODE),state);