How to get value of groups claim in Angular SPA

Hi, I am trying to get user’s groups in my Angular application. With @okta/okta-angular I am able to get profile information of the user like so:

this.oktaAuth.getUser().then((user) => {
  console.log(user); // contains profile information

I cannot get user’s groups even if I add scopes to the okta sign in widget.
I am able to get groups in Spring Boot application (it is an SPA).

Any ideas how to get groups on the client (Angular) side?

Navigate to API > Authorization Servers, and click on the default server. Click the Claims tab and Add Claim. Name it groups, and include it in the ID Token. Set the value type to Groups and set the filter to be a Regex of .* . Click Create .