Skip to content

Overwrite state query parameter #5

@DeepakAK47

Description

@DeepakAK47

I'm wondering would it be possible to overwrite totally the value of state queryparameter in the final URL?
Because of several reasons I'm not able to pass a simple string value, which would be required for the given API, what I want to use.

hello.init(
{
'network': {
...
login: (p) => {
p.qs.state = someCustomValue;
}
}
}
);

But in this case, when I set string or null value for someCustomValue I get the following errors:
TypeError: Cannot create property 'oauth' on string 'I am a string'
TypeError: Cannot set property 'oauth' of null

hello.js line: 365:

// Add the oauth endpoints
p.qs.state.oauth = provider.oauth;

In summary, my current URL looks like this:

https://login.api.com/auth/authentication/connect/authorize?
nonce=MyNonce
&client_id=MyClientId
&response_type=code
&redirect_uri=https%3A%2F%2Fgateway%2Flogin
&state=%7B%22client_id%22%3A%22MyClientId%22%2C<....>2C%22oauth_proxy%22%3A%22%2Foauthproxy%22%7D
&scope=openid
And I'd like to look like this:

https://login.api.com/auth/authentication/connect/authorize?
nonce=MyNonce
&client_id=MyClientId
&response_type=code
&redirect_uri=https%3A%2F%2Fgateway%2Flogin
&state=MyCustomStringValueHere
&scope=openid

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions