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);
varresponseTypes=toList(json,RESPONSE_TYPE);
for(varresponseType:responseTypes){
for(varresponseType:responseTypes){
switch(responseType){
switch(responseType){
caseID_TOKEN:
caseID_TOKEN:
caseTOKEN:
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:
caseCODE:
break;
break;
default:
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);