Angular 7: What's New and Noteworthy

Angular 7: What’s New and Noteworthy

This post explains what’s new in Angular 7 and shows options for adding authentication to an Angular app. You’ll also learn about OAuth 2.0, implicit flow, and authorization code flow.

Richard Corkery

Matt, I tried both of you Angular 7 tutorials listed above. I didn’t have much luck with the angular-oauth2-oidc example (it wouldn’t even redirect me to the Okta Log In page). But the SDK example did redirect me to the okta login page. And I was able to successfully log in. (The okta portal indicated I was successfully login with my app.) However, ever after I successfully log in, oktaAuth.isAuthenticated() is still set to false. Any ideas on what I could be doing wrong. I found a similar demo on the okta git site but they are using Angular 5. I also got the some results when I port their code over into my Angular App. Any ideas on what I could be doing wrong? Do you have the source code for these demos in git? Let me know. Thanks.

Bart

I’ll leave this here in case someone wonders or has any ideas.

After your oidc redirect happens back to your app, the tokens get set, in my case i had a navguard that triggered before the tokens are set.

This caused the tokens to never be stored due to the navguard responding before the oidc client library could store the tokens.

Matt Raible

Hello Richard,

You might try the following tutorials. I’ve tested them both with Angular 8:

* Angular 8 + Spring Boot 2.2: Build a CRUD App Today!
* Use Angular Schematics to Simplify Your Life

Richard Corkery

Hi Bart, Thanks for the replay. I was able to fix this issue a while. However, I can’t remember what was the resolution. Thanks for chiming in.

Richard Corkery

Hi Matt,

Thanks for following up. I was able to resolve this issue a while ago. Honestly not sure what I did to fix it. But, thanks for the message back.

Richard Corkery

I remember now how I fixed this problem. I had to get an administrator to go into menu item: API | Trusted Origin and make the url a trusted API. This had to be set up manually. It did not happen by default.