Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

redirectForTokenAsync is supposed to be redirectForToken #177

Open
tonyeung opened this issue Feb 12, 2016 · 2 comments
Open

redirectForTokenAsync is supposed to be redirectForToken #177

tonyeung opened this issue Feb 12, 2016 · 2 comments

Comments

@tonyeung
Copy link

Inspecting the manager at runtime shows that redirectForTokenAsync does not exist. Also the dts also doesn't have that property.

@ezrichie2006
Copy link

ezrichie2006 commented May 2, 2016

Confirmed - doesn't exist.

Here's my code from the walk through:

 //c# code in clients.cs
public static IEnumerable<Client> Get()
        {
            return new[]
            {
                new Client
                {
                    Enabled = true,
                    ClientName = "JS Client",
                    ClientId = "js",
                    Flow = Flows.Implicit,

                    //RedirectUris = new List<string> { "http://localhost:62894/popup.html"},//for a popup window to appear
                    RedirectUris = new List<string> { "https://localhost:44356", "http://localhost:62894", "http://localhost:62894/popup.html" },
                    //RedirectUris = new List<string> { "http://localhost:62894" },//to process a redirect uri directly within same window
                    AllowedCorsOrigins = new List<string> { "http://localhost:62894"},
                    AllowAccessToAllScopes = true

                },
            };
        }
//javascript code - index.html
var settings = {
            authority: 'https://localhost:44356',
            client_id: 'js',
            //redirect_uri: 'https://localhost:44356',
            redirect_uri: 'http://localhost:62894',//this one works
            popup_redirect_uri: 'http://localhost:62894/popup.html',//this one works
            response_type: 'id_token',
            scope: 'openid profile',
            filter_protocol_claims: false

        };

        var manager = new OidcTokenManager(settings);

        //$('.js-login').click(function () {
        //    manager.openPopupForTokenAsync()
        //        .then(function () {
        //            display('.js-id-token', manager.profile);
        //        }, function (error) {
        //            console.error(error);
        //        });
        //});

        $('.js-login').click(function () {
            manager.redirectForToken()
                .then(function () {
                    display('.js-id-token', manager.profile);
                }, function (error) {
                    console.error(error);
                });
        });

@dseelinger
Copy link

dseelinger commented Jun 10, 2016

It looks like the redirectForToken doesn't work for the Windows Auth - All-in-one server. Looks like there may be a hard dependency on some login UI of some sort. It works OK if RequireConsent=true, but not if RequireConsent=false and the need for login/consent UI is totally eliminated.

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

No branches or pull requests

3 participants