fixing bugs:

1. error formatting caused error on OIDC login
2. sending credentials to OIDC provider

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-09-17 11:45:51 +02:00
parent 296c040180
commit f9f94ee674
2 changed files with 2 additions and 2 deletions

View File

@@ -19,7 +19,7 @@ public class UmbrellaException extends RuntimeException{
}
public UmbrellaException(int statusCode, String message, Object ... fills){
super(format(message,fills));
super(fills == null || fills.length<1 ? message : format(message,fills));
this.statusCode = statusCode;
}

View File

@@ -282,7 +282,7 @@ public class UserModule extends BaseHandler implements UserService {
var location = state.config.getString(TOKEN_ENDPOINT);
try {
var data = Map.of(GRANT_TYPE,AUTHORIZATION_CODE, CODE,code,REDIRECT_URI,redirect);
var data = Map.of(GRANT_TYPE,AUTHORIZATION_CODE, CODE,code,REDIRECT_URI,redirect,CLIENT_ID,state.loginService.clientId(),CLIENT_SECRET,state.loginService.clientSecret());
var resp = request(location,data,MIME_FORM_URL,state.loginService.basicAuth());
if (!(resp instanceof JSONObject json)) return sendContent(ex,HTTP_BAD_REQUEST,format("{0} did not return JSON!",location));
if (!json.has(ID_TOKEN)) return sendContent(ex,HTTP_FAILED_DEPENDENCY,"Missing ID token token exchange failed!");