owin

Owin WS-Federation setting up token sliding expiration

笑着哭i 提交于 2019-12-06 04:20:04
问题 Can somebody explain how to implement sliding expiration using the new Owin WS-Federation plugin? On the client side, at WS-Fedeartion configuration I see that there are some events like : Notifications = new WsFederationAuthenticationNotifications { SecurityTokenReceived = ..., AuthenticationFailed = ..., RedirectToIdentityProvider = ..., MessageReceived = ..., SecurityTokenValidated = .... }, But because the lack of documentation I can't really figure it out where an how? At the moment my

C# Owin WebApp: Parsing POST Requests?

痴心易碎 提交于 2019-12-06 04:10:31
问题 I would like some help on parsing HTTP POST requests in a C# console application. The app runs a 'web-server' using Owin. Details of the application are available here and the current 'stable version' of the relevant code is here. I am extending the above application to enable configuration through the web UI. For example, the app currently reports a large number of parameters. I would like the end-user to be able to select which parameters get reported over the network. Towards this, I made

Authenticating a .NET MVC application with a Web Api

吃可爱长大的小学妹 提交于 2019-12-06 04:05:50
问题 I have a Web Api 2 project based on SPA VS 2013 Template. I have a bearer token authentication configured in that Api. I also have a separate MVC 5 project, I want to authenticate using that Web Api. Is that possible? How? What I did so far (in my Mvc Client) : using (var client = new HttpClient()) { client.BaseAddress = new Uri("http://localhost/MyApi/"); var response = client.PostAsync("Token", new StringContent("grant_type=password&username=teste&password=123456", Encoding.UTF8)).Result;

Too many OpenID.nonce cookies cause “Bad Request”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 03:41:19
问题 I have already gone through links here, here and here which are related to issue I am having. I have Silverlight application using IdentiServer3 for authentication and I started having this issue just now when I implemented log out functionality. Note that the issue has nothing to do with Silverlight because login and logout functionality is actually implemented on the server side which is a classic ASP.Net Web form. (.NET 4.5.1) The application never had logout functionality, so user just

Add Owin Pipeline Middleware after OwinStartup for new Tenant

随声附和 提交于 2019-12-06 03:30:47
问题 I have a multi-tenant application where each tenant can define their own ClientID, Authority, etc for either WsFed or OpenIdConnect. All the tenants are registered in the OwinStartup as below: public void Configuration(IAppBuilder app) { List<WsFederationAuthenticationOptions> WsFedTenantOptions = BuildWsFedTenantOptionsList(); List<OpenIdConnectAuthenticationOptions> OpenIdConnectTenantOptions = BuildOpenIdConnectTenantOptionsList(); app.SetDefaultSignInAsAuthenticationType

NullReferenceException with Owin

此生再无相见时 提交于 2019-12-06 03:06:53
问题 I've just cloned a project to a new machine and I'm getting a hard-to-debug NullReferenceException on a MVC site with OWIN: [NullReferenceException: Object reference not set to an instance of an object.] Microsoft.Owin.Security.Cookies.<AuthenticateCoreAsync>d__0.MoveNext() +664 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices

Microsft Owin Facebook authentication is not working in MVC application

坚强是说给别人听的谎言 提交于 2019-12-06 03:01:45
I am working in Asp.Net MVC appplication. I am using the default visual studio project template. Google authentication is working fine but facebook doesn't. I specified a valid appId and appSecred generated on my facebook developer portal and the app is available to the public. app.UseFacebookAuthentication( appId: "111111111111", appSecret: "aaaaaaaaa"); After the user tries to login with facebook, the system redirects to https://localhost:44301/Account/Login# = It is not entering to /Account/ExternalLoginCallback, so I assume the login failed. Can somebody tell me what I am doing wrong?

Use WebAPI 2 without OWIN authentication middleware

雨燕双飞 提交于 2019-12-06 02:51:29
问题 I would like to use ASP.NET WebAPI 2, but with my own authentication mechanism. I have tried to remove all the code that comes with SPA template in VS 2013, as well as normal WebAPI template. If I remove all auth-related code from the project and don't configure OWIN in it's Startup.Auth, I always get an error, that OWIN middleware authentication is not setup and I can't get to any controller's action. What is the correct way to implement a token based authentication in WebAPI 2 with own code

Authorization_code grant flow on Owin.Security.OAuth: returns invalid_grant

不羁的心 提交于 2019-12-06 02:21:56
问题 I am trying to setup my authentication using the authorization_code grant flow. I had it previously working with grant_type=password , so I kind of know how the stuff is supposed to work. But when using grant_type=authorization_code , I couldn't make it return anything other than invalid_grant Here is my setup: app.UseOAuthAuthorizationServer(new OAuthAuthorizationServerOptions { AllowInsecureHttp = true, TokenEndpointPath = new PathString("/auth/token"), AccessTokenExpireTimeSpan = TimeSpan

No IUserTokenProvider is registered when using dependency injection

邮差的信 提交于 2019-12-06 01:59:33
问题 I got an error when my GeneratePasswordResetTokenAsync() method is call. I configured autofac with owin identity. The error is : No IUserTokenProvider is registered when using dependency injection In my sample.web project there is a AutofacConfig.cs file where I register signinmanager and usermanager which I created in sample.repository project. AutofacConfig.cs public class AutofacConfig { public static Autofac.IContainer RegisterDependencies() { var containerBuilder = new ContainerBuilder()