Skip to content
This repository has been archived by the owner on Mar 3, 2022. It is now read-only.

signoutPopupCallback method missing #254

Closed
ADCJustinH opened this issue Jan 31, 2017 · 5 comments
Closed

signoutPopupCallback method missing #254

ADCJustinH opened this issue Jan 31, 2017 · 5 comments
Assignees
Labels
Milestone

Comments

@ADCJustinH
Copy link

Issue / Steps to reproduce the problem

This may be a misunderstanding of intent but it seems that in oidc-client js the popup signout methods are missing. I was able to get the client working for popup signin my Cordova app (thanks for including those changes btw) but on signout the popup window does not close automatically. I couldn't find a sample using the signoutPopup method so perhaps it does work and I'm just doing something wrong.

Looking through the code I found the callback that was bound to the popup window and I made this work by including this code in my signout callback page:

  if(window.opener && window.opener.hasOwnProperty('popupCallback_undefined')){
            window.opener.popupCallback_undefined(window.location.href);
        }

obviously this is not how it was meant to be used and using undefined instead of id/state may lead to trouble later but it works for now.

Is there an example/doc I missed or is the signout equivalent to

var mgr = new Oidc.UserManager();
mgr.signinPopupCallback();

just missing as I suspect?

Thanks,
Justin

@brockallen
Copy link
Member

Ok, I'll reexamine the APIs to see if this makes sense.

@brockallen brockallen added this to the 1.3.0 milestone Mar 28, 2017
@brockallen
Copy link
Member

I looked into this and you're absolutely right -- somehow I overlooked the signout popup code. I think I meant to remove it when I ported from oidc-client-manager, but the signoutPopup seems to have been sort of worked on but never properly completed (which I'm somewhat embarrassed by). ANyway, I worked on this some yesterday and added the signoutPopupCallback -- look at the updated sample and see if it works for you. You can test it with the npm release 1.3.0-beta.4.

@ravikatha
Copy link

Please add the method definition to the typescript definition file too.

@brockallen
Copy link
Member

brockallen commented Mar 30, 2017

Please add the method definition to the typescript definition file too.

Done. I wasn't sure if TS allowed method overloading, so this was added:

        signoutPopupCallback(url?: string, keepOpen?: boolean): Promise<void>;
        signoutPopupCallback(keepOpen?: boolean): Promise<void>;

Is that legal TS?

@brockallen
Copy link
Member

@ADCJustinH I know this was opened a while ago and you might not be in a position to test. I'll close this for now, and if you do ever get to the point of testing please let me know how it's working for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants