Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overwrite state query parameter #628

Open
baloghbence0915 opened this issue Jun 23, 2020 · 0 comments
Open

Overwrite state query parameter #628

baloghbence0915 opened this issue Jun 23, 2020 · 0 comments

Comments

@baloghbence0915
Copy link

baloghbence0915 commented Jun 23, 2020

Hi there,

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.

I'm able to do such a thing:

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;

Version: 2.0.0-4

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

Thanks in advance,
Bence

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

No branches or pull requests

1 participant