Skip to content

Feature request: Provide support for options, login_hint and additional url parameters in popup overload #976

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

Open
gingters opened this issue Nov 11, 2020 · 3 comments
Labels
feature-request Improvements and additions to the library.

Comments

@gingters
Copy link
Contributor

Is your feature request related to a problem? Please describe.

In an application we want to provide an option for a quick user-switch, without losing the state of the current components.
For that we'd like to open up a sign-in Popup on the AS (using auth code flow with pkce), and provide a login_hint (we know the user we want to switch to), as well as optional acr_values to the AS.

We noticed that the method that starts the login in a popup window does not accept the login_hint and also no additional url_parameters.

Describe the solution you'd like

While looking at the code we noticed that the method initLoginFlowInPopup does internally use a method that accepts both the login_hint as well as additional parameters, but does not expose these in its own signature:

https://github.com/manfredsteyer/angular-oauth2-oidc/blob/master/projects/lib/src/oauth-service.ts#L1062-L1071

It would be awesome if the method would expose at least the required, but ideally all parameters of the initLoginFlow method (additionalState, params) and pass them along.

Describe alternatives you've considered
Sadly no other idea comes to our mind ;)

Additional context
None.

We could also think of doing this ourselves and provide a PR, if you'd be willing to accept this.

@jeroenheijmans jeroenheijmans added the feature-request Improvements and additions to the library. label Nov 11, 2020
@jeroenheijmans
Copy link
Collaborator

Makes sense to me. It'll be up to the maintainer to tag it 'pr-welcome' but I presume the popup version should support the same stuff the other one does?

@gingters
Copy link
Contributor Author

Ideally yes. I could think of simply adding the arguments to the end and pass the expected default values if they are undefined, a bit like so so:

 public initLoginFlowInPopup(options?: { height?: number; width?: number }, additionalState: string = '', loginHint: string = '', additionalParameters: object = {}) {
    options = options || {};
    additionalParameters.display = 'popup';

    return this.createLoginUrl(
      additionalState,
      loginHint,
      this.silentRefreshRedirectUri,
      false,
      additionalParameters
    ).then(url => {

But of course this needs testing etc.

@sagialter88
Copy link

hi ,
is this issue going to be promoted?
we also need this solution to our project.

thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Improvements and additions to the library.
Projects
None yet
Development

No branches or pull requests

3 participants