# How to convert spring boot app with Okta to read okta groups

**URL:** <https://devforum.okta.com/t/how-to-convert-spring-boot-app-with-okta-to-read-okta-groups/25079>\
**Category:** OAuth/OIDC\
**Created:** [August 18, 2023, 6:28pm UTC](https://devforum.okta.com/t/how-to-convert-spring-boot-app-with-okta-to-read-okta-groups/25079 "2023-08-18T18:28:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![markd](https://avatars.discourse-cdn.com/v4/letter/m/839c29/32.png) [@markd](https://devforum.okta.com/u/markd)\
**Post date:** [August 18, 2023, 6:28pm UTC](https://devforum.okta.com/t/how-to-convert-spring-boot-app-with-okta-to-read-okta-groups/25079/1 "2023-08-18T18:28:00Z")

</div>

Hello!

A while back, I created a spring book application that uses Okta as the OIDC provider. It’s based on a previous version of this great example by Matt Raible:

[Use React and Spring Boot to Build a Simple CRUD App](https://developer.okta.com/blog/2022/06/17/simple-crud-react-and-spring-boot)

What I’m trying to do now is obtain the group or roles for the logged in user.

Based on Matt’s response on SO, I added the claims group in the admin interfaced and converted the app to the okta spring boot starter kit.

However, when I print the Authorities, I still don’t see the groups. The only authority I see is this:

Authority: ROLE\_USER Username: [xxxxx@gmail.com](mailto:xxxxx@gmail.com)

Heres the code which prints the authorities:

```auto
Collection<? extends GrantedAuthority> authorities = principal.getAuthorities();
for (GrantedAuthority authority : authorities) {
    System.out.println("Authority: " + authority.getAuthority());
}

```

Is there anything I’m doing wrong here?

Thanks!

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [February 15, 2024, 11:50pm UTC](https://devforum.okta.com/t/how-to-convert-spring-boot-app-with-okta-to-read-okta-groups/25079/2 "2024-02-15T23:50:58Z")

</div>


