admin管理员组

文章数量:1293920

I am trying to connect to a new OAuth Identity Provider from my Angular app. The logout is implemented with an userManager.signoutRedirect() call to UserManager provided by oidc-client-ts.

Logout works well with my old Identity Provider, where the /token/revocation endpoint called under the hood returns without Content-Type header (Content-Length is 0) But the new OAuth server returns the Content-Type: text/plain; charset=utf-8 header (still without actual content), which results in the following error:

ERROR Error: Invalid response Content-Type: text/plain; charset=utf-8, from URL: .../token/revocation.

The response status is 200 OK.

Is there a way I can set the Accept header on my logout request with the oidc-client-ts library, or any other fix for this issue?

I am trying to connect to a new OAuth Identity Provider from my Angular app. The logout is implemented with an userManager.signoutRedirect() call to UserManager provided by oidc-client-ts.

Logout works well with my old Identity Provider, where the /token/revocation endpoint called under the hood returns without Content-Type header (Content-Length is 0) But the new OAuth server returns the Content-Type: text/plain; charset=utf-8 header (still without actual content), which results in the following error:

ERROR Error: Invalid response Content-Type: text/plain; charset=utf-8, from URL: .../token/revocation.

The response status is 200 OK.

Is there a way I can set the Accept header on my logout request with the oidc-client-ts library, or any other fix for this issue?

Share asked Feb 12 at 14:35 AnnoszAnnosz 1,0327 silver badges25 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I've found the solution at https://github/authts/oidc-client-ts/issues/1650.

There is a parameter which can be set in the UserManagerSettings:

const settings: UserManagerSettings = {
    authority: ...,
    client_id: ...,
    redirect_uri: ..., 
    revokeTokenAdditionalContentTypes: ['text/plain; charset=utf-8'],
};

本文标签: openid connectInvalid response contenttype on logout with oidcclientts in AngularStack Overflow