Missing "email" property from oktaAuth.getUser() after upgrading project from Angular 7 to 15.2.9

@okta/okta-angular: ^1.1.0
@angular/core: ^15.2.9

As mentioned in title, the “email” property is now missing when I call oktaAuth.getUser() in my code. The “displayName”, “sub”, and “groups” properties and still showing normally. I have already addressed all compilation/build errors and so far this missing property is the only issue I’m experiencing since the major version upgrades.

I can also confirm that the “email” property is still returning when running the pre-upgrade (Angular 7) version of the project, so this shouldn’t have anything to do with the OKTA admin panel.

Are you requesting the email scope in your application? If you manually take the Access Token stored in TokenManager and send it to the Userinfo Endpoint (which is what getUser() calls), do you see the email returned?

Figured it out, I just tried a few different versions of @okta/okta-angular to test. The next non-major version (1.2.0) worked for me. Thank you for your help.

1 Like

Hey there @spaghettiboi22! Glad to hear you were able to find a solution! I want to give you a heads-up.

Does adding the email scope work if you use a more recent version of @okta/okta-angular?

The version you are using, v1.2.0, appears quite outdated, as the most recent version is v6. You will need to upgrade to @okta/okta-angular v6+ when you upgrade to Angular v16. With the switch to Ivy and the deprecation of View Engine, Angular removed ngcc in Angular v16, which means it’s no longer View Engine compatible and you’ll need to use the Ivy-compatible Okta Angular SDK v6+.

1 Like

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