Browse Source

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>
feature/grid
Stephan Richter 2 months ago
parent
commit
f9f94ee674
  1. 2
      core/src/main/java/de/srsoftware/umbrella/core/exceptions/UmbrellaException.java
  2. 2
      user/src/main/java/de/srsoftware/umbrella/user/UserModule.java

2
core/src/main/java/de/srsoftware/umbrella/core/exceptions/UmbrellaException.java

@ -19,7 +19,7 @@ public class UmbrellaException extends RuntimeException{ @@ -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;
}

2
user/src/main/java/de/srsoftware/umbrella/user/UserModule.java

@ -282,7 +282,7 @@ public class UserModule extends BaseHandler implements UserService { @@ -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!");

Loading…
Cancel
Save