Skip to content

Commit

Permalink
Fix uri resolution for admin token authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
toddkazakov committed Nov 20, 2020
1 parent ffe8693 commit 505827b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,15 @@
import javax.ws.rs.NotFoundException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.UriInfo;

public abstract class AdminResource {

@Context
protected ClientConnection clientConnection;

@Context
private HttpHeaders headers;

@Context
private KeycloakSession session;

@Context
protected UriInfo uriInfo;

protected AdminPermissionEvaluator auth;

protected void setup() {
Expand All @@ -60,7 +53,7 @@ protected void setup() {

// Temporarily set the realm in the context to the admin realm to make sure we have a valid admin token
session.getContext().setRealm(realm);
AuthenticationManager.AuthResult authResult = authManager.authenticateBearerToken(session, realm, uriInfo, clientConnection, headers);
AuthenticationManager.AuthResult authResult = authManager.authenticateBearerToken(session, realm);
if (authResult == null) {
throw new NotAuthorizedException("Bearer");
}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<name>Keycloak Extensions</name>

<properties>
<extensions-version>0.0.5-SNAPHOT</extensions-version>
<extensions-version>0.0.6-SNAPSHOT</extensions-version>
</properties>

<modules>
Expand Down

0 comments on commit 505827b

Please sign in to comment.