Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

CodeGrantFlow custom Authorization headers #198

Open
srinuhamps opened this issue Jun 3, 2019 · 0 comments
Open

CodeGrantFlow custom Authorization headers #198

srinuhamps opened this issue Jun 3, 2019 · 0 comments

Comments

@srinuhamps
Copy link

I am using codegrant flow and everything as per the documentation works, I'm sure I can work around the silent refresh as well based on the provided comments. But the only issue I've been facing is "unable to set my custom headers"

I have to send Authorization as "Basic xxxxxxxxxx" along with 'Content-Type': 'application/x-www-form-urlencoded' as per my requirement. Unfortunately I don't see any feasibility in doing so.

Let me know if you have any other workaround for achieving this. because I made some modifications in the library and it worked for me.

Below are the changes in file:

HEADER: this.headers in constants
header = { ...header }; in makePOSTRequest method.

Below is the configuration:

authData: {
tenant: 'tenant',
ClientId: 'ClientId',
AppWebDomain: 'AppWebDomain',
TokenScopesArray: ['openid'],
RedirectUriSignIn: window.location.origin,
UserPoolId: 'UserPoolId',
RedirectUriSignOut: window.location.origin,
grant_type: 'grant_type',
client_secret: 'client_secret',
cacheLocation: 'localStorage',
IdentityProvider: 'IdentityProvider',
AdvancedSecurityDataCollectionFlag: false,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
Authorization: 'Basic XDXDXDXGFXHGGFXFXFXFXFXXDXDXDXDXDXDDXDXDX'
}

}

I have also attached the modified file here.

CognitoAuth.txt

I have a critical deadline to fix this issue.
Appreciate your quick thoughts on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant