{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Security/issues/1473","repository_url":"https://api.github.com/repos/aspnet/Security","labels_url":"https://api.github.com/repos/aspnet/Security/issues/1473/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Security/issues/1473/comments","events_url":"https://api.github.com/repos/aspnet/Security/issues/1473/events","html_url":"https://github.com/aspnet/Security/issues/1473","id":263964693,"node_id":"MDU6SXNzdWUyNjM5NjQ2OTM=","number":1473,"title":"[Announcement] WsFederation 2.0.0-preview1 out of band release","user":{"login":"Tratcher","id":1821173,"node_id":"MDQ6VXNlcjE4MjExNzM=","avatar_url":"https://avatars3.githubusercontent.com/u/1821173?v=4","gravatar_id":"","url":"https://api.github.com/users/Tratcher","html_url":"https://github.com/Tratcher","followers_url":"https://api.github.com/users/Tratcher/followers","following_url":"https://api.github.com/users/Tratcher/following{/other_user}","gists_url":"https://api.github.com/users/Tratcher/gists{/gist_id}","starred_url":"https://api.github.com/users/Tratcher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tratcher/subscriptions","organizations_url":"https://api.github.com/users/Tratcher/orgs","repos_url":"https://api.github.com/users/Tratcher/repos","events_url":"https://api.github.com/users/Tratcher/events{/privacy}","received_events_url":"https://api.github.com/users/Tratcher/received_events","type":"User","site_admin":false},"labels":[{"id":288049966,"node_id":"MDU6TGFiZWwyODgwNDk5NjY=","url":"https://api.github.com/repos/aspnet/Security/labels/discussion","name":"discussion","color":"5319e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/aspnet/Security/milestones/12","html_url":"https://github.com/aspnet/Security/milestone/12","labels_url":"https://api.github.com/repos/aspnet/Security/milestones/12/labels","id":1300196,"node_id":"MDk6TWlsZXN0b25lMTMwMDE5Ng==","number":12,"title":"Discussions","description":"","creator":{"login":"Eilon","id":202643,"node_id":"MDQ6VXNlcjIwMjY0Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/202643?v=4","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":51,"state":"open","created_at":"2015-09-10T22:38:46Z","updated_at":"2018-07-05T19:04:32Z","due_on":null,"closed_at":null},"comments":138,"created_at":"2017-10-09T17:05:54Z","updated_at":"2018-07-13T08:54:14Z","closed_at":null,"author_association":"MEMBER","body":"WsFederation preview support is now available for ASP.NET Core 2.0.0. The Microsoft.AspNetCore.Authentication.WsFederation 2.0.0-preview1 package is available at https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.WsFederation/. This is a standalone preview that targets netstandard2.0 and should work with existing ASP.NET Core 2.0.0 applications (.NET Core 2.0 or .NET 4.6.1). A non-preview ASP.NET Core 2.0.0 compatible package will follow once we’ve addressed your feedback.\r\n \r\nThe code is available at https://github.com/aspnet/security/tree/rel/2.0.0-ws-preview1 and issues can be filed at https://github.com/aspnet/security/issues. Please give us a 👍 from the reactions menu on this post if you have successfully used this component and are ready for the final release.\r\n \r\nThis component is a port from Microsoft.Owin.Security.WsFederation and uses many of the same mechanics. It has also been updated to integrate with ASP.NET Core 2.0’s authentication model. See the samples below.\r\n \r\nAside from updating the usage pattern to match ASP.NET Core, there are also some functional changes to be aware of.\r\nA.\tThis component no longer checks every form post request for sign-in messages by default. Sign-in callbacks are restricted to the \"/signin-wsfed\" path by default. The CallbackPath can be changed to the application root “/” used by some auth providers if you also enable SkipUnrecognizedRequests to allow sharing that request path with other components.\r\nB.\tThis component no longer allows unsolicited logins by default. That WsFederation protocol feature is susceptible to XSRF attacks. See the AllowUnsolicitedLogins option to opt into that feature if your application requires it.\r\n \r\nSamples:\r\n \r\nFor applications only using WsFederation (similar to using OpenIdConnect):\r\n \r\n        public void ConfigureServices(IServiceCollection services)\r\n        {\r\n            services.AddAuthentication(sharedOptions =>\r\n            {\r\n                sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n                sharedOptions.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;\r\n                sharedOptions.DefaultChallengeScheme = WsFederationDefaults.AuthenticationScheme;\r\n            })\r\n            .AddWsFederation(options =>\r\n            {\r\n                options.Wtrealm = Configuration[\"wsfed:realm\"];\r\n                options.MetadataAddress = Configuration[\"wsfed:metadata\"];\r\n            })\r\n            .AddCookie();\r\n        }\r\n \r\n        public void Configure(IApplicationBuilder app)\r\n        {\r\n           app.UseAuthentication();\r\n \r\n                         // …\r\n        }\r\n \r\nFor applications using WsFederation with Identity:\r\n \r\n            services.AddAuthentication()\r\n                .AddWsFederation(options =>\r\n                {\r\n                    options.Wtrealm = Configuration[\"wsfed:realm\"];\r\n                    options.MetadataAddress = Configuration[\"wsfed:metadata\"];\r\n                });\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Security/issues/comments/404771025","html_url":"https://github.com/aspnet/Security/issues/1473#issuecomment-404771025","issue_url":"https://api.github.com/repos/aspnet/Security/issues/1473","id":404771025,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDc3MTAyNQ==","user":{"login":"AnshulKhandelwal02","id":26767886,"node_id":"MDQ6VXNlcjI2NzY3ODg2","avatar_url":"https://avatars0.githubusercontent.com/u/26767886?v=4","gravatar_id":"","url":"https://api.github.com/users/AnshulKhandelwal02","html_url":"https://github.com/AnshulKhandelwal02","followers_url":"https://api.github.com/users/AnshulKhandelwal02/followers","following_url":"https://api.github.com/users/AnshulKhandelwal02/following{/other_user}","gists_url":"https://api.github.com/users/AnshulKhandelwal02/gists{/gist_id}","starred_url":"https://api.github.com/users/AnshulKhandelwal02/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AnshulKhandelwal02/subscriptions","organizations_url":"https://api.github.com/users/AnshulKhandelwal02/orgs","repos_url":"https://api.github.com/users/AnshulKhandelwal02/repos","events_url":"https://api.github.com/users/AnshulKhandelwal02/events{/privacy}","received_events_url":"https://api.github.com/users/AnshulKhandelwal02/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T08:54:14Z","updated_at":"2018-07-13T08:54:14Z","author_association":"NONE","body":"Still the issue I am facing is to get webApi authenticated with bearer token received from web authentication.\r\n1. Created web app, Angular template of .net core 2.1. Aded WsFed authentication to it. https://demoapp\r\n2. Created Web Api app. Added wsfed authentication to it. https://demoapp-api\r\n3. Now target is to authenticate web app, use token from there to make calls to api, and get data.\r\n4. In WebApp, in OnTicketReceived WsFederationEvent, acquiring token using AcquireTokenAsync(AppId, credential);\r\n5. Passing this token as Bearer token in header to API. \r\n6. When hitting API, facing redirection for authentication. \r\n7. Ideally, when sending token, it should be allowed, right ?\r\n\r\nI have added permissions of WebAPI on WebAPP in Azure portal, and also vice-versa.\r\nAcquiring token using AppSecret.\r\n\r\nAm I missing something here ? Or I am trying to achieve something which is not possible with WsFed ?\r\nCan anyone please help with this webapp-webapi-wsfed scenario ?\r\n"}}
{"actor":{"display_login":"AnshulKhandelwal02"}}