ws-federation

How do I move federationConfiguration out of web.config and to some custom config file and load it dynamically by code

こ雲淡風輕ζ 提交于 2019-12-03 08:52:15
I have my configuration in web.config and it works fine. <configuration> <system.identityModel.services> <federationConfiguration> .... </federationConfiguration> </system.identityModel.services> </configuration> How do I move this out of web.config to a custom config file and load it from code? I want to use the same structure of this configuration so that I do not have to change anything in code if I have to change this configuration file. You can tap into the WIF event from your global.asax void Application_Start(object sender, EventArgs e) { // Code that runs on application startup

Federated authentication in Sharepoint 2013: getting rtFa and FedAuth cookies

喜你入骨 提交于 2019-12-03 07:38:00
问题 The scenario is the following: I need to perform a federated authentication of a user (which uses his university account) into the Sharepoint site of his university and to obtain both the FedAuth and rtFa cookies (which I have to pass to SharePoint REST webservices in order to access resources). I made some attempts but there is at least an issue in each one: 1) Using Microsoft.SharePoint.Client library ClientContext context = new ClientContext(host); SharePointOnlineCredentials creds = new

WS-Federation sign-in Asp.NET 5 MVC 6 ADFS

孤街醉人 提交于 2019-12-03 07:08:24
Hello so I've been trying to achieve WS-Fed SSO on my MVC6 web application, I've read a bit on authentification and all to identify my requirements. I have to use WsFederationAuth so no oauth nor saml protocol would work for me. Edit : After @Pinpoint suggestion I tried to use owin middleware to achieve the connection, but I will use the full framework DNX451 rather than DNXCore but it's something while waiting for ws-fed to be supported by Vnext. Pinpoint adapter extension : public static class AppBuilderExtensions { #if !DNXCORE50 public static IApplicationBuilder UseOwinAppBuilder(this

WIF- ID1014: The signature is not valid. The data may have been tampered with

旧城冷巷雨未停 提交于 2019-12-03 06:53:40
I've been using WIF to authenticate our new website, the STS is based upon the starter-sts implementation. To enable this to work correctly on out load balanced environment I've used the following in the global.asax to override the default certificate behaviour. void onServiceConfigurationCreated(object sender, ServiceConfigurationCreatedEventArgs e) { List<CookieTransform> sessionTransforms = new List<CookieTransform>(new CookieTransform[] { new DeflateCookieTransform(), new RsaEncryptionCookieTransform(e.ServiceConfiguration.ServiceCertificate), new RsaSignatureCookieTransform(e

Federated authentication in Sharepoint 2013: getting rtFa and FedAuth cookies

[亡魂溺海] 提交于 2019-12-02 21:06:47
The scenario is the following: I need to perform a federated authentication of a user (which uses his university account) into the Sharepoint site of his university and to obtain both the FedAuth and rtFa cookies (which I have to pass to SharePoint REST webservices in order to access resources). I made some attempts but there is at least an issue in each one: 1) Using Microsoft.SharePoint.Client library ClientContext context = new ClientContext(host); SharePointOnlineCredentials creds = new SharePointOnlineCredentials(user, passw); context.Credentials = creds; Uri sharepointuri = new Uri(host)

Invoking webapi throws No Access-Control-Allow-Origin header is present on the requested resource

点点圈 提交于 2019-12-02 07:55:51
问题 I'm trying to follow an Azure sample to integrate Azure AD into my MVC 4.6 web app via WSFederation provided here https://github.com/Azure-Samples/active-directory-dotnet-webapp-wsfederation This sample works as expected. However, when I add a WebApi controller in the same MVC project and decorate with [Authorize] it errors out. I have an ajax request for GET method in this newly added WebApi controller. Error is: XMLHttpRequest cannot load https://login.microsoftonline.com/85c96496-fbc6-4bf3

what protocol to use with ADFS when security webapi for non-browser clients

匆匆过客 提交于 2019-12-02 04:02:06
问题 Our webapi endpoints are used for both browser based clients (angular) and non-browser based clients (restsharp) and the webapi are currently secured using passive WS-Federation as the protocol and ADFS as the STS. We currently use a rather convoluted workaround for the restsharp clients since passive WS-Federation really isn't optimal for non-browser clients so we would like to find a better way to secure our webapi endpoints for these types of clients without having to replace ADFS or add

Invoking webapi throws No Access-Control-Allow-Origin header is present on the requested resource

怎甘沉沦 提交于 2019-12-02 03:04:38
I'm trying to follow an Azure sample to integrate Azure AD into my MVC 4.6 web app via WSFederation provided here https://github.com/Azure-Samples/active-directory-dotnet-webapp-wsfederation This sample works as expected. However, when I add a WebApi controller in the same MVC project and decorate with [Authorize] it errors out. I have an ajax request for GET method in this newly added WebApi controller. Error is: XMLHttpRequest cannot load https://login.microsoftonline.com/85c96496-fbc6-4bf3-bfcc-fb51ca874527/wsfe…UIWNgv-EANzWADAQPCOqF--3c7KGt6G21ucvLkce_wMcwVguKz62ioyGPxQg&wa=wsignin1.0. No

.NET Core WsFederation Authentication login loop on localhost

此生再无相见时 提交于 2019-12-01 10:54:39
I'm trying to implement WsFederation Azure AD authentication into my app, so that users must sign in as soon as they hit the application. However, when the app starts, it directs to the AAD instance, but then gets stuck in a loop with a blank screen. My app runs on http://localhost:61213/ , in which I've added it as a ReplyUrl in the Azure App Registration dashboard. Other answers to this suggest that the app should be running over https, however when I've tried to implement those changes, it still doesn't work. Any ideas? Thanks in advance! Edit I've changed the app to use SSL in VS, so it

.NET Core WsFederation Authentication login loop on localhost

萝らか妹 提交于 2019-12-01 10:06:55
问题 I'm trying to implement WsFederation Azure AD authentication into my app, so that users must sign in as soon as they hit the application. However, when the app starts, it directs to the AAD instance, but then gets stuck in a loop with a blank screen. My app runs on http://localhost:61213/, in which I've added it as a ReplyUrl in the Azure App Registration dashboard. Other answers to this suggest that the app should be running over https, however when I've tried to implement those changes, it