# Spring boot Angular user Group Id in authorities

**URL:** <https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461>\
**Category:** Questions\
**Created:** [November 26, 2018, 4:42am UTC](https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461 "2018-11-26T04:42:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![balu.vyamajala](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@balu.vyamajala](https://devforum.okta.com/u/balu.vyamajala)\
**Post date:** [November 26, 2018, 4:42am UTC](https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461/1 "2018-11-26T04:42:22Z")

</div>

I have used tutorial

> **[Build a Basic CRUD App with Angular 7.0 and Spring Boot 2.1](https://developer.okta.com/blog/2018/08/22/basic-crud-angular-7-and-spring-boot-2)**
>
> Angular and Spring Boot are arguably the two most popular frameworks in all of web development. Matt Raible shows you how to use them together in the same app, and how to secure it all with Okta.

and created angular and spring boot application. Everything works perfect. I just need to receive logged in user group from Okta as authority , so, I can secure my apis based on role/group.  
for this purpose, I create two groups

 ![image](https://global.discourse-cdn.com/oktadev/original/1X/118ec216be99e80bb73be2a4c1e752405df6dcb3.png)

and in the application, I have given access to both the group users.

 ![image](https://global.discourse-cdn.com/oktadev/original/1X/ebbec793f0cff4ef9ffa2484845ad062ec1f49cc.png)  
Then in Api Authorization servers added claims to provide groups matching regex .\* for both type access and type Id.  
However, I am still not able to receive group id of the user cm\_user or cm\_admin in spring boot application authorities of the Principle.  
Please advice what I am missing and let me know if any additional details are needed.

Another thing, I want to mention is, token fetched from “Preview Token” app, is returning roles properly, however, they are not being set as authorities in spring boot.

---

<div class="post-metadata">

**Author:** ![balu.vyamajala](https://avatars.discourse-cdn.com/v4/letter/b/eb9ed0/32.png) [@balu.vyamajala](https://devforum.okta.com/u/balu.vyamajala)\
**Post date:** [November 26, 2018, 5:15am UTC](https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461/2 "2018-11-26T05:15:34Z")

</div>

I think, I found the issue. I had to debug spring boot okta-spring-security-oauth2 jar to figure this out.  
Basically, its looking by default for ‘groups’ , where as okta is returning the groups as ‘roles’  
I just had to add okta.oauth2.rolesClaim as ‘roles’

We can close this request. hope it helps some one.

---

<div class="post-metadata">

**Author:** ![po2040234](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/po2040234/32/1654_2.png) [@po2040234](https://devforum.okta.com/u/po2040234)\
**Post date:** [February 21, 2020, 7:26pm UTC](https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461/3 "2020-02-21T19:26:47Z")

</div>

Hi @balu.vyamajala,

I’ve been struggling with the same issue, could you share some snippets of your configuration and properties ?

Thank you !

Best Regards,

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [January 23, 2024, 10:38pm UTC](https://devforum.okta.com/t/spring-boot-angular-user-group-id-in-authorities/3461/4 "2024-01-23T22:38:29Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
