Skip to content
Snippets Groups Projects
Verified Commit d32dd867 authored by Ira ¯\_(ツ)_/¯'s avatar Ira ¯\_(ツ)_/¯
Browse files

Formatting fixes

parent 379f496a
No related branches found
No related tags found
No related merge requests found
......@@ -8,10 +8,11 @@ import org.keycloak.services.managers.AppAuthManager;
import org.keycloak.services.managers.AuthenticationManager;
/**
* A custom REST resource in the form of a domain extension which makes the custom endpoint
* accessible just for authenticated users. The REST request must be authenticated with bearer
* access token of an authenticated user and the user must be part of a pre-configured realm role in
* order to access the resource.
* A custom REST resource in the form of a domain extension which makes the
* custom endpoint accessible just for authenticated users. The REST request
* must be authenticated with bearer access token of an authenticated user and
* the user must be part of a pre-configured realm role in order to access the
* resource.
*/
public class MailPassRestResource {
......@@ -32,8 +33,7 @@ public class MailPassRestResource {
private void checkRealmAdmin() {
if (auth == null) {
throw new NotAuthorizedException("Bearer");
} else if (auth.getToken().getRealmAccess() == null
|| !auth.getToken().getRealmAccess().isUserInRole("admin")) {
} else if (auth.getToken().getRealmAccess() == null || !auth.getToken().getRealmAccess().isUserInRole("admin")) {
throw new ForbiddenException("Does not have realm admin role");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment