# IDX10501: Signature validation failed. Unable to match key, Angular frontend, .core 3 backend

**URL:** <https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990>\
**Category:** Questions\
**Created:** [January 21, 2022, 10:18am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990 "2022-01-21T10:18:53Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 21, 2022, 10:18am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/1 "2022-01-21T10:18:53Z")

</div>

I have an angular app where I use octa login, this seems to work fine, as I log in and get a couple of tokens.

When I then send the accessToken to my backen API, I get the IDX10501 error while authenticating it. If I use [jwt.io](http://jwt.io) to decode the token, I can see that I do indeed have a different key.

In my angular app I’m using “@okta/okta-signin-widget”: “^5.16.0”,  
I’m using a fairly default config

```auto
widget = new OktaSignIn({
    authParams: {
       scopes: ['openid', 'email', 'profile'],
    },
    issuer: `${environment.oktaDomain}/oauth2/default`,
    clientId: environment.oktaClientId,
    redirectUri: window.location.origin + '/login/callback',
}
    ...
    this.widget.showSignInAndRedirect()

```

In my dotnet core 3.1 app I have the following code:

```auto
           services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
                .AddJwtBearer(options =>
                {
                    options.Authority = $"{Configuration["Authentication:OktaDomain"]}/oauth2/default";
                    options.Audience = "api://default";

```

Using developer tools in chrome I can see that the showSignInAndRedirect results in a call like this:  
`${environment.oktaDomain}/oauth2/v1/authorize?client_id=${environment.oktaClientId}...`

I’ve tried changing baseurl, issuer and added issuer to authParams, but none of them seems to change the authorize url that is called to “/oauth2/default/v1/authorize?client\_id=” witch I think is the right URI.

IS the authorize url the issue? How do I fix this?

---

<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 21, 2022, 9:28pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/2 "2022-01-21T21:28:18Z")

</div>

Try removing the issuer setting in your widget. By default, the widget will try to use the Default Auth Server (note that the use of this server will be dependent on your org features), so you shouldn’t need to set it there.

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 24, 2022, 8:15am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/3 "2022-01-24T08:15:25Z")

</div>

Hi  
I’ve tried with just issuer, just baseUrl and both of them. I’ve also tried setting baseUrl + authParms.issuer. All of these goes against the  
`${environment.oktaDomain}/oauth2/v1/authorize?client_id=${environment.oktaClientId}`  
And get’s the wrong key.

I’ve been able to manually verify the JWT token from the front end using the key’s I get from:  
/.well-known/openid-configuration  
But I’m unable to get a JWT token from the front end widget with the key that corresponds to this:  
/oauth2/default/.well-known/openid-configuration

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 24, 2022, 12:27pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/4 "2022-01-24T12:27:46Z")

</div>

This probably won’t help @hpevjuonyx but are you using the default Okta authorisation server or a custom one? Maybe its using one instead of the other?

Perhaps also verify the angular generated URLs are hitting the correct auth server and endpoints?

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 24, 2022, 12:50pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/5 "2022-01-24T12:50:09Z")

</div>

I’m trying to use the custom default authorization server, but no matter what I do, the octa sign in widget seems to keep hitting the default authrization server. Or in other words:

Widget calls this:  
`${environment.oktaDomain}/oauth2/v1/authorize?client_id=${environment.oktaClientId}...`

I think it should be calling this:  
`${environment.oktaDomain}/oauth2/default/v1/authorize?client_id=${environment.oktaClientId}..`

---

<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, 2022, 4:10pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/6 "2022-01-24T16:10:02Z")

</div>

If you’re using a self-hosted widget, can you try using the following for your widget config?

```auto
var signIn = new OktaSignIn(
    {
        baseUrl: "https://org.okta.com",
        clientId: CLIENT_ID,
        redirectUri: REDIRECT_URI,
        /*
        authParams:{
            issuer: "https://org.okta.com/oauth2/default",
        }
        */
    }
)

```

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 25, 2022, 2:42am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/7 "2022-01-25T02:42:52Z")

</div>

Key bit is probably ensuring the custom auth server identifier is in your base URL like:  
[https://domain.okta.com/oauth2/ausbu123456aaaa333](https://domain.okta.com/oauth2/ausbu123456aaaa333)

So the URL generated by  
${environment.oktaDomain}/oauth2/v1/authorize?client\_id=${environment.oktaClientId}

Should look something like:  
([https://domain.okta.com/oauth2/ausbu123456aaaa333](https://domain.okta.com/oauth2/ausbu123456aaaa333))/oauth2/v1/authorize?client\_id=123456789

Need to make sure the okta domain for your custom auth server uri is in your common Okta SDK config so it can resolve the /keys endpoint which should also look something like [https://domain.okta.com/oauth2/ausbu123456aaaa333/v1/keys](https://domain.okta.com/oauth2/ausbu123456aaaa333/v1/keys)

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 25, 2022, 8:05am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/8 "2022-01-25T08:05:44Z")

</div>

I’m not using a self-hosted widget, but I did try your code anyway, and I’m still getting the wrong authorize url, and thus also the wrong key.

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 25, 2022, 8:08am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/9 "2022-01-25T08:08:32Z")

</div>

I’m trying to use the default custom authorization server (ie my id is “default”)

> [@abole](#):
>
> the okta domain for your custom auth server uri is in your common Okta SDK config

I don’t know where in my angular code you are refering to, can you give me a code example using the okta widget?

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 25, 2022, 1:21pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/10 "2022-01-25T13:21:34Z")

</div>

Somewhere in your angular code you should have a config object defined which looks like @andrea 's example above. If you grabbed the Okta angular SDK from github and are following the guide there ([GitHub - okta/okta-angular: Angular SDK for Okta's OIDC flow](https://github.com/okta/okta-angular)) the config seems to be in myApp.module.ts

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 25, 2022, 2:45pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/11 "2022-01-25T14:45:32Z")

</div>

You mean this object from my first post?

> [@hpevjuonyx](#):
>
> ```auto
> widget = new OktaSignIn({
> authParams: {
> scopes: ['openid', 'email', 'profile'],
> },
> issuer: `${environment.oktaDomain}/oauth2/default`,
> clientId: environment.oktaClientId,
> redirectUri: window.location.origin + '/login/callback',
> }
> 
> ```

As I’ve been trying to say, I’ve tries several variants of this config object but I always get the wrong keys/ authorize URL

- Only issuer
- Only baseUlr
- baseUrl with authParams.issuer
- baseurl with issuer
- baseurl with issuer and authParams.issuer  
I’m using these versions

```auto
    "@okta/okta-angular": "^5.1.0",
    "@okta/okta-auth-js": "^5.9.0",
    "@okta/okta-signin-widget": "^5.16.1",

```

---

<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 25, 2022, 6:05pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/12 "2022-01-25T18:05:27Z")

</div>

Did you try putting the `issuer` option within the `authParams` object?

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 25, 2022, 10:46pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/13 "2022-01-25T22:46:23Z")

</div>

What does ${environment.oktaDomain} resolve to? Does it have your custom Auth Server identifier?

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 26, 2022, 8:00am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/14 "2022-01-26T08:00:41Z")

</div>

yes, makes no difference

---

<div class="post-metadata">

**Author:** ![hpevjuonyx](https://avatars.discourse-cdn.com/v4/letter/h/ea666f/32.png) [@hpevjuonyx](https://devforum.okta.com/u/hpevjuonyx)\
**Post date:** [January 26, 2022, 8:01am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/15 "2022-01-26T08:01:58Z")

</div>

> [@abole](#):
>
> [https://domain.okta.com](https://domain.okta.com)

domain = devtechonyxcentersource

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 26, 2022, 11:10am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/16 "2022-01-26T11:10:37Z")

</div>

> [@abole](#):
>
> [https://domain.okta.com/oauth2/ausbu123456aaaa333](https://domain.okta.com/oauth2/ausbu123456aaaa333)

It needs to resolve to [https://domain.okta.com/oauth2/](https://domain.okta.com/oauth2/)  
e.g. [https://devtechonyxcentersource.okta.com/oauth2/ausbu123456aaaa333](https://devtechonyxcentersource.okta.com/oauth2/ausbu123456aaaa333)

So no difference with that URL?

---

<div class="post-metadata">

**Author:** ![abole](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/abole/32/3030_2.png) [@abole](https://devforum.okta.com/u/abole)\
**Post date:** [January 26, 2022, 11:15am UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/17 "2022-01-26T11:15:27Z")

</div>

Re-reading your first post, it sounds like you’re doing online introspection of the token to validate it. The other thing to double-check if your backend API is able to authenticate correctly.

> **[OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#request-parameters-4)**
>
> Find information about the OAuth 2.0 and OpenID Connect endpoints that Okta exposes on its authorization servers.

**Note:** The `/introspect` endpoint requires client authentication. Most client authentication methods require the `client_id` and `client_secret` to be included in the Authorization header as a Basic auth base64-encoded string with the request. See the [Client authentication methods](https://developer.okta.com/docs/reference/api/oidc/#client-authentication-methods) section for more information on which method to choose and how to use the parameters in your request.

---

<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:** [February 12, 2024, 6:09pm UTC](https://devforum.okta.com/t/idx10501-signature-validation-failed-unable-to-match-key-angular-frontend-core-3-backend/18990/18 "2024-02-12T18:09:34Z")

</div>

Closed on February 12, 2024, 6:09pm UTC


