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:
@@ -19,7 +19,7 @@ public class UmbrellaException extends RuntimeException{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public UmbrellaException(int statusCode, String message, Object ... fills){
|
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;
|
this.statusCode = statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ public class UserModule extends BaseHandler implements UserService {
|
|||||||
var location = state.config.getString(TOKEN_ENDPOINT);
|
var location = state.config.getString(TOKEN_ENDPOINT);
|
||||||
|
|
||||||
try {
|
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());
|
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 (!(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!");
|
if (!json.has(ID_TOKEN)) return sendContent(ex,HTTP_FAILED_DEPENDENCY,"Missing ID token – token exchange failed!");
|
||||||
|
|||||||
Reference in New Issue
Block a user