Documentation icon indicating copy to clipboard operation
Documentation copied to clipboard

redirectForTokenAsync is supposed to be redirectForToken

Open tonyeung opened this issue 9 years ago • 2 comments

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

tonyeung avatar Feb 12 '16 20:02 tonyeung

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);
                });
        });

ezrichie2006 avatar May 02 '16 17:05 ezrichie2006

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.

dseelinger avatar Jun 10 '16 17:06 dseelinger