How to Work with Angular and MySQL

Matt Raible

Hello Larry,

This is likely because you created a new app on Okta and used the default (Authorization Code flow). If you modify your app to use Implicit flow, everything should work. Since this tutorial was written, we changed the default from Implicit to Authorization Code Flow. Another (more secure) option is to change your Angular client to turn on PKCE. To do this, change your code in src/app/app.module.ts to turn on PKCE.


OktaAuthModule.initAuth({
issuer: ‘https://{yourOktaDomain}/oauth2/default’,
redirectUri: ‘http://localhost:4200/implicit/callback’,
clientId: ‘{yourClientId}’,
pkce: true
})

I realize I used a lot of buzzwords in this answer. If you’d like clarification on any terms, please let me know. We have lots of other blog posts and YouTube videos that help explain these concepts.

You could also create a bare-bones Angular app and add Okta for Auth with OktaDev Schematics. See https://github.com/oktadeveloper/schematics#angular for more information.