wif

Owin OAuth provider “The entity type IdentityUser is not part of the model for the current context”

心已入冬 提交于 2019-12-22 00:15:35
问题 UserManagerFactory = () => new UserManager<IdentityUser>(new UserStore<IdentityUser>()); OAuthOptions = new OAuthAuthorizationServerOptions { TokenEndpointPath = new PathString("/Token"), Provider = new ApplicationOAuthProvider(PublicClientId, UserManagerFactory), AuthorizeEndpointPath = new PathString("/api/AccountOwin/ExternalLogin"), AccessTokenExpireTimeSpan = TimeSpan.FromDays(14), AllowInsecureHttp = true }; From which IdentityUser,UserStore comesform entity framework. I want to use my

BootstrapContext is null on ClaimsIdentity

耗尽温柔 提交于 2019-12-21 10:08:09
问题 I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, containing the desired claims, on Thread.CurrentPrincipal. Now I need the bootstrap token to secure the calls to my service layer. I have set the saveBootstrapContext to true on the identityConfiguration element. <system.identityModel> <identityConfiguration saveBootstrapContext="true"> However, the

Programatically Configuring federatedAuthentication element in microsoft.identityModel on asp.net application

拈花ヽ惹草 提交于 2019-12-21 05:06:47
问题 I am trying to programatically generate the following configuration contained inside the microsoft.identityModel configuration. <federatedAuthentication> <wsFederation passiveRedirectEnabled="false" requireHttps="true" issuer="https://IssuedByFoo.com" realm="http://Foo.com/" /> <cookieHandler requireSsl="true" path="/" /> </federatedAuthentication> So far I have not been able to successfully configure this. I have tried setting the following in application_Start but I get an error message

How do you pass a (Claims) security Token to a WIF enable WCF service

戏子无情 提交于 2019-12-21 04:50:05
问题 I am curious to find out how we could possibly send a Security token from a WIF application that has already been authenticate to a WIF enabled WCF Service. Any assistance will be appriciated 回答1: The answer is not simple but the following steps constitute the 'recommended pattern' and are documented in the following MSDN article: Identity Delegation with AD FS 2.0 Step-by-Step Guide In summary Allow you web application access to a special token (Bootstrap Token) that can be used to request

How to hold the cookies claims updated with MCV5/OWIN

一个人想着一个人 提交于 2019-12-21 04:25:15
问题 We’re working on an OWIN MVC5 project. We use an own implementation of IUserStore<T> to integrate the user-management which is part of our companies framework. So far this works fine. We want to provide role membership and other security configuration through claims. I have seen (and quickly tested) the ways of either implementing IUserClaimStore<T> or of attaching a ClaimsIdentityFactory to the UserManager. In both scenarios, I see the issue that the claims are stored in the user’s cookie

Delivering a JWT SecurityToken to a WCF client

杀马特。学长 韩版系。学妹 提交于 2019-12-20 04:26:21
问题 I need to generate and issue a token to clients based on username/password authentication. I've tried several approaches to solving this problem, but all of them have run into issues. My first plan was to implement WS-Trust Issue on my WCF endpoint. The example I found which did this used: [OperationContract(Action = "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue", ReplyAction = "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue")] Message IssueToken(Message rstMessage); However,

WIF - FederatedSignOut not signing user out all sites

萝らか妹 提交于 2019-12-20 04:08:18
问题 I am using Windows Identity Foundation. (With some MVC 2.0 sites) I am having real problem signing someone out of all the sites protected by WIF. It looks like my sign out is only signing people out on the current site. This is my code public void FederatedSignOut(string replyUrl) { var authModule = FederatedAuthentication.WSFederationAuthenticationModule; WSFederationAuthenticationModule.FederatedSignOut(new Uri(authModule.Issuer), new Uri(replyUrl)); } After running this code i can still

How can I make a security token automatically expire in a passive STS setup?

◇◆丶佛笑我妖孽 提交于 2019-12-20 02:37:09
问题 I have a passive STS set up for a new application I'm working on. I've noticed that when a user's session expires, the user is still authenticated. I would have thought that when the session expires, the user would no longer be authenticated. My boss discussed this with me as I am currently charged with setting up the authentication. He says that it would be good if we could make the user's log on expire after a certain period of inactivity similar to how the session expires. I am familiar

Why would FederatedAuthentication.WSFederationAuthenticationModule be null in MVC Azure ACS Federated Authentication?

青春壹個敷衍的年華 提交于 2019-12-19 08:50:37
问题 I'm trying to put together FederatedAuthentication with .NET 4.5, MVC 4, and active redirect using a custom server-side login page, using code from this tutorial, and from this code sample. Redirecting to the LogOn method of my AccountController works fine, and the method looks like this: public ActionResult LogOn() { HrdClient hrdClient = new HrdClient(); WSFederationAuthenticationModule fam = FederatedAuthentication.WSFederationAuthenticationModule; /*** Fails here because this is null **/

A custom login page for Azure ACS not working

不打扰是莪最后的温柔 提交于 2019-12-19 04:14:05
问题 I downloaded the sample login page from the ACS portal for my application, which is a html file. I then configured my application with WIF, and everything worked perfectly. Since we need to handle and save an incoming querystring, so that querystring can be used later after the user had been logged in, we needed to move the html login page to a aspx page. The problem is that when I change the issuer for WIF in the web.config file to the aspx file, it stops working. When it works it looks like