# Make angular app authentification/authorization work with pkce

**URL:** <https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008>\
**Category:** Questions\
**Created:** [April 22, 2020, 12:58pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008 "2020-04-22T12:58:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![advii](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@advii](https://devforum.okta.com/u/advii)\
**Post date:** [April 22, 2020, 12:58pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/1 "2020-04-22T12:58:13Z")

</div>

Below my app settings:

 ![Screenshot 2020-04-22 at 14.45.11](https://global.discourse-cdn.com/oktadev/original/2X/9/9239a4bb2550b571096dd86ac65d28da0d3bcb48.png)

I have my plain vanilla angular app (accessing a spring boot service) and I installed okta schematics with it. apparently it sets up pkce by default. this has not worked for me because of the following error:  
[OAuth2 token request](https://dev-xxxxx-admin.okta.com/dev/console#)

[failure](https://dev-xxxxxx-admin.okta.com/dev/console#) : invalid\_token\_endpoint\_auth\_method

then I modified the code a bit, added logout redirect uri to the app and made the implicit code flow work.  
Now what do I have to change in my angular app and/or my okta application settings to make pkce workflow work?

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 22, 2020, 1:29pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/2 "2020-04-22T13:29:24Z")

</div>

You need to create a SPA app for Angular, not a Web app like you’re using. A web app requires a client secret when using Auth code flow, a SPA app uses PKCE when using Auth code flow.

---

<div class="post-metadata">

**Author:** ![advii](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@advii](https://devforum.okta.com/u/advii)\
**Post date:** [April 24, 2020, 3:23pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/3 "2020-04-24T15:23:23Z")

</div>

if I am to have a spring boot service that can be accessed from angular, android app and postman, do I then have to create different apps for each type of client? Or what would be the recommended workflow for such a scenario?

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [April 24, 2020, 11:15pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/4 "2020-04-24T23:15:14Z")

</div>

It’s possible you could use a native app for both Angular and Android since both our SDKs support PKCE. For Postman requests, you’ll need a way to get an access token to make your requests. You could code something up in Spring Boot to display an access token, or create an app with implicit flow and use something like [https://oidcdebugger.com](https://oidcdebugger.com) to retrieve the token.

---

<div class="post-metadata">

**Author:** ![advii](https://avatars.discourse-cdn.com/v4/letter/a/898d66/32.png) [@advii](https://devforum.okta.com/u/advii)\
**Post date:** [May 8, 2020, 9:26am UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/5 "2020-05-08T09:26:54Z")

</div>

thank you for the answer. could you recommend a good blog post or other kind of instruction on how to implement the native app workflow? I guess I can handle the Postman case:)

---

<div class="post-metadata">

**Author:** ![mraible](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/mraible/32/37_2.png) [@mraible](https://devforum.okta.com/u/mraible)\
**Post date:** [May 14, 2020, 7:02pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/7 "2020-05-14T19:02:47Z")

</div>

Here’s a blog post I wrote about React Native that might help.

> **[Create a React Native App with Login in 10 Minutes](https://developer.okta.com/blog/2019/11/14/react-native-login)**
>
> This tutorial shows you how to add a login feature to a React Native application.

---

<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:** [January 24, 2024, 7:25pm UTC](https://devforum.okta.com/t/make-angular-app-authentification-authorization-work-with-pkce/9008/8 "2024-01-24T19:25:15Z")

</div>


