KEYCLOAK-746 Allow linking to account from external provider
This commit is contained in:
parent
eac1fb23cf
commit
4d401224de
1 changed files with 6 additions and 3 deletions
|
@ -70,6 +70,7 @@ import org.keycloak.util.UriUtils;
|
|||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.GET;
|
||||
import javax.ws.rs.HttpMethod;
|
||||
import javax.ws.rs.OPTIONS;
|
||||
import javax.ws.rs.POST;
|
||||
import javax.ws.rs.Path;
|
||||
|
@ -181,11 +182,13 @@ public class AccountService {
|
|||
throw new ForbiddenException();
|
||||
}
|
||||
|
||||
if (!request.getHttpMethod().equals("GET")) {
|
||||
String referrer = headers.getRequestHeaders().getFirst("Referer");
|
||||
if (referrer != null && !requestOrigin.equals(UriUtils.getOrigin(referrer))) {
|
||||
throw new ForbiddenException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (authResult != null) {
|
||||
UserSessionModel userSession = authResult.getSession();
|
||||
|
|
Loading…
Reference in a new issue