owin

Resolve No owin.Environment item was found in the context

和自甴很熟 提交于 2020-01-15 02:55:09
问题 I have found many threads discussing this problem but getting any of them to work has eluded me so far. I have been trying to follow ProDinner as a way of learning how to implement role based authentication in my app. But I cannot work out what I am missing. Every time I try to log in I get No owin.Environment item was found in the context After a lot of debugging and searching I have found the Startup class is not being called. I've tried to resolve by stepping through the proDinner code to

Windows Service hosting Web API 2 via Owin Starts and Immediately Stops with no Exceptions Thrown

两盒软妹~` 提交于 2020-01-14 14:08:52
问题 The title sums up my issue. I have try-catch blocks around the service's OnStart method and the Main method in the service, and no exception is ever thrown. The service starts and immediately stops, with the following message: The Foo service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs. The same behavior can be observed on the test server, so it is not machine-dependent. I've verified that the configuration

Why am I getting “The magic number in GZip header is not correct.” error using OWIN auth against Azure SQL

送分小仙女□ 提交于 2020-01-14 09:39:30
问题 Nothing on Google or SO relates to this specific problem, so asking a new question. I created a brand new Asp.Net MVC Web Application with the standard user-security option. I also created an empty database in Azure. I did nothing but change the default connection string to this: <connectionStrings> <add name="DefaultConnection" connectionString="data source=mydatabase.database.windows.net;initial catalog=Feedback;persist security info=True;user id=LeaveFeedbackuser;password=mypassword

Why can't users authenticate after deploying locally the ASP.NET 4.6 application to the IIS 10 server?

核能气质少年 提交于 2020-01-13 20:28:31
问题 In my ASP.NET Web Forms application I am using ASP.NET Identity 2.2 for the membership system. The Development stage works as expected. Users get authenticated and have access to different areas of the website according to their roles. After the deployment to the IIS 10 local server the authentication is overturned. The login is successful and, yet, the user does not authenticate. The Login page loads once again empty and fresh. I know that the login is successful through some test I've made

Microsft Owin Facebook authentication is not working in MVC application

北城余情 提交于 2020-01-13 13:13:10
问题 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

Microsft Owin Facebook authentication is not working in MVC application

不问归期 提交于 2020-01-13 13:12:37
问题 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

structuremap Web Api 2 Account Controller and individual accounts

无人久伴 提交于 2020-01-13 08:59:49
问题 I pretty New at IOC and web-api 2, but have got StructureMap to work on my own Controllers in web-api 2. What I don't have managed is to use StructureMap on the AccountController using Individual Accounts. I use AccountController out of the Box, and what I have managed so far is following: In Ioc.cs I have added following (Because of errors) x.For<IUserStore<ApplicationUser>>().Use<UserStore<ApplicationUser>>(); x.For<DbContext>().Use(() => new ApplicationDbContext()); x.For<ISecureDataFormat

Authenticating requests to Microsoft.Owin.Testing.TestServer

扶醉桌前 提交于 2020-01-13 07:48:11
问题 I'm using the owin TestServer class to unit test my web api. It's working great except that I'm unsure how to authenticate requests, so I can't really test endpoints that require authentication, other than to make sure that unauthenticated requests are unauthorized. I am configuring WebApi to use only bearer token authentication as indicated here: // Web API configuration and services // Configure Web API to use only bearer token authentication. config.SuppressDefaultHostAuthentication();

HttpContext.Current.Session is null + OWIN

纵然是瞬间 提交于 2020-01-12 03:29:10
问题 I'm entirely new to OWIN and this issue has been a major blocker for me. Basically, at my MVC app I have the following at Startup class: public partial class Startup { public void ConfigureAuth(IAppBuilder app) { app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseOpenIdConnectAuthentication( new OpenIdConnectAuthenticationOptions { ClientId = OfficeSettings.ClientId, Authority =

Use External Access Token or Local Access Token

此生再无相见时 提交于 2020-01-11 19:57:35
问题 I am developing an application using ASP.NET MVC 5.2.2, Web API 2.2 and Katana/OWIN 3.0 . The application uses ASP.NET Identity 2.1 for local accounts and database. I am using OAuth Authorization Server to generate access and refresh token. I have Android and IOS apps which uses my local oauth authorization server. Android and IOS apps uses SDK to login with Facebook, Google, etc. After that the apps will send the (Facebook/Google/etc) access token to the server. The server will validate