Stupid question here: is there a way to avoid quer...
# support-questions-legacy
i
Stupid question here: is there a way to avoid query params chars from authorizationEndpointQueryParams to be encoded in the authorizationEndpoint ? I need to set a query parm to a sctring-encoded JSON object (ex http://authorizationEndpoint.url?claims={"userinfo":{"email":null,"email_verified":null}} ) but it keeps me encoding all special chars of the string Thank you in advance <
r
hey @ilbarbarossa you can override the frontend functino for getAuthorizationUrl and then manually change the URL however you like after calling the original implementation.
i
Thank you. It worked like a 🧤 (p.s. function is getAuthorisationURLWithQueryParamsAndSetState) Here the code snippet for who is interested:
Copy code
ts
override: {
                functions: (originalImplementation, builder) => {
                    return {
                        ...originalImplementation,
                        getAuthorisationURLWithQueryParamsAndSetState(input){
                            return originalImplementation.getAuthorisationURLWithQueryParamsAndSetState(input)
                                .then((result) => {
                                    return result.concat('&claims=').concat(twitchClaims);
                                });
                        }
                    }
                },
            }
unfortunately it still encoding quotes and double quotes...mmm
ex
export const twitchClaims = '{"userinfo":{"email":null,"email_verified":null,"picture":null}}';
the " char gets encoded into %22
maybe i am doing something wrong 🤔
r
the override you showed above is from the frontend SDK?
i
It is yes. But i actually found the real problem (it not depends on special chars econding): To actually get the info like email, email_verified ecc. from twitch /userinfo endpoint it is necessary to insert the scope "**openid**" among the others! So after adding openid scope, moved the setting of claims param into the backend, like it should be, (inside authorizationEndpointQueryParams) with a simple JSON.stringify(twitchClaims) I finally managed to recover the email from userinfo! I hope I was clear. Thanks again @rp_st for the support and sorry for the inconvenience ❤️
r
awesome!
3 Views