Skip to content

AdditionalParameters in response are always null #209

@benmac

Description

@benmac

I do not know if this is a bug or a lack of understanding on my part. We are using the library with Identity Server 4. and attempting to make use of the additionalParameters on the response. The reason for this is we have a language selector on the IDS4 login page and we wish to send the language back to the app, so the app can adjust accordingly. Identity Server has been modified to send the token back to the app with a return url of OurAppName:/oathredirect?lang=en.
Using Charles (Web debugging proxy) we can see that the response is definitely sent with the "lang" url parameter(see attached land.png).
lang
Code to call IDS4

return authorize(Auth.getConfig())
      .then(authDetails => {
        const { lang } = authDetails.additionalParameters;

        if (!lang) return authDetails;

        return Auth.setUserLang(lang, authDetails.accessToken).then(() => authDetails);
      })
      .then(authDetails => {
        store.dispatch(addAuth(authDetails));
        return authDetails;
      })
      .catch(e =>
        Auth.logout().then(() => {
          throw e;
        })
      );
static getConfig() {
    const { apis: { identityServerURL } } = store.getState();

    return {
      issuer: identityServerURL,
      clientId: IDENTITY_SERVER_CLIENT_ID,
      redirectUrl,
      additionalParameters: {},
      scopes: ['openid', 'profile', 'offline_access'],
      dangerouslyAllowInsecureHttpRequests: true,
    };
  }

Yet when run const { lang } = authDetails.additionalParameters;

authDetails.additionalParameters is always null

Am i missing something in how i am doing this or is this an issue?
note: i have tried with additionalParameters: {}, in the config and without

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions