keycloak 11 & nest-keycloak-connect 1.3.0-alpha.3 - fail to get 200 with roles
See original GitHub issueHi,
I’m trying to make this project work with latest keycloak docker instance (currently version 11.x).
Using a fresh nestjs project with latest nest-keycloak-connect i’m using the following code :
@Controller()
@Resource('admin')
export class AppController {
constructor(private readonly appService: AppService) {}
@Get('admin')
@Roles('admin')
getHello(): string {
return this.appService.getHello();
}
}
I have setup a keycloak custom realm, with a scope “admin” and a role “admin” under it. Here is the decoded jwt I try to pass to the app :
{
"exp": 1598143670,
"iat": 1598143370,
"jti": "f5b80827-0573-4710-a548-14ace94d1473",
"iss": "http://localhost:8080/auth/realms/testproject",
"sub": "e85763bd-281a-4fca-86a0-f7afcaaf46d2",
"typ": "Bearer",
"azp": "admin-cli",
"session_state": "e7b4e27b-8cba-4124-9d41-c1659ceeec23",
"acr": "1",
"realm_access": {
"roles": [
"admin"
]
},
"scope": "email admin roles profile",
"email_verified": true,
"name": "admin",
"preferred_username": "admin",
"given_name": "admin",
"family_name": "admin",
"email": "admin@admin.com"
}
I also try to add @Scopes(‘admin’), without much more success.
Do I miss something ? Which version of keycloak is supported by this lib ?
Thanks for your help.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Release Notes - Keycloak
We are happy to announce that the new Keycloak Operator for the Quarkus based distribution is no longer a preview feature. We added...
Read more >Server Administration Guide - Keycloak
Admin , user , manager , and employee are all typical roles that may exist in an organization. Applications often assign access and...
Read more >Server Administration Guide - Keycloak
Token mappers - Map user attributes, roles, etc. how you want into tokens and statements. Not-before revocation policies per realm, application ...
Read more >Upgrading Guide - Keycloak
This guide describes how to upgrade Keycloak. It is recommended that you start by upgrading the Keycloak server first and Keycloak adapters ...
Read more >Keycloak 20.0.0 released
We are happy to announce that the new Keycloak Operator for the Quarkus based distribution is no longer a preview feature.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Tickets like this seems to be more rampant, I’ll soon be putting up a proper example project so people won’t get confused later on.
I’ll check if there are any breaking changes, then I’ll do a release