owin

SignalR: /signalr/abort throws error

十年热恋 提交于 2019-12-06 01:47:33
问题 Refused to execute script from '.../signalr/abort?transport=webSockets&clientProtocol=1.5&callback=jQuery32109752453231046265_1507885522267&_=1507885522271' because its MIME type ('') is not executable, and strict MIME type checking is enabled. A part of url was removed for clarity. I have the last stable version of Microsoft.Owin.Host.SystemWeb (3.1.0) and jquery.signalR-2.2.2.js . I'm using CORS. /signalr/start is working just fine. Any ideas? 来源: https://stackoverflow.com/questions

What is the process that makes IIS start responding to requests through the Owin pipeline?

让人想犯罪 __ 提交于 2019-12-06 01:27:24
问题 If you create an empty ASP.NET Web Application project in Visual Studio 2013 open the package manager console and install-package Microsoft.Owin.Host.SystemWeb Add a Startup class with a Configuration(IAppBuilder app) method, for example: public class Startup { public void Configuration(IAppBuilder app) { app.Run(context => context.Response.WriteAsync("hello")); } } And run, you'll see hello show up in the browser. However, it you look at the project, there's no change to any files, namely to

How do I enable the TypeScript tab of a Visual Studio project that's a console or windows service that's self-hosting web-pages

爱⌒轻易说出口 提交于 2019-12-05 23:07:33
Using Visual Studio 2015 I created a console application to self-host Owin with embedded static files. Since Visual Studio doesn't know it's a web-site project, it ignores TypeScript files. When I go to the project properties, the TypeScript tab's typically there in web projects is missing. How do I enabled the TypeScript tab so that I can configure TypeScript and use Visual Studio 2015's built-in capabilities to compile TypeScript. Open the .csproj file in a text editor and add the following line <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)

Facebook v2.4 with OAuth2 stopped working and only getting name and id

落花浮王杯 提交于 2019-12-05 21:47:38
Something changed from facebook APIs v2.3 to v2.4 - after using 2.4 I can only get name and id, I saw some posts talking about adding a "?fields=scopes..." but it's a true mystery for me - I'm trying to understand how to send these scope fields... Here is my code: var facebookAuthOptions = new FacebookAuthenticationOptions(); facebookAuthOptions.AppId = facebookAuthAppId; facebookAuthOptions.AppSecret = facebookAuthAppSecret; facebookAuthOptions.Scope.Add("email"); facebookAuthOptions.Scope.Add("user_birthday"); facebookAuthOptions.Scope.Add("public_profile"); facebookAuthOptions.Provider =

Identity disappears from bearer token after an hour

こ雲淡風輕ζ 提交于 2019-12-05 21:16:32
I am working on a multi-tenant solution with Azure AD with web apps and a web api. The web app uses OpenIdConnect to retrieve a bearer token (which is cached in Azure Redis Cache), which is used in Angular to get JSON from the web api. User impersonation is used between the web app and web api (set up in Azure AD applications). Problem: This works fine for about an hour, then the Identity suddenly disappears on the web api side. If I refresh the web app, I see that the page is redirected to the Microsoft login page, but no action is required since the user is just redirected back to the web

OWIN multi-app bearer token authentication

做~自己de王妃 提交于 2019-12-05 19:39:57
问题 I want to make a modification to the default single page application template for ASP.NET in VS 2013, which currently uses bearer token authentication. The sample uses app.UseOAuthBearerTokens to create both the token server and the middleware to validate tokens for requests in the same app. What I'd like to do is leave that in place, but add a second application (bound in IIS to the same domain, different path - e.g. /auth/* for the authentication server, and /app1/* for the app). For the

Azure ADAL Refresh id_token

て烟熏妆下的殇ゞ 提交于 2019-12-05 18:05:58
We are developing a multi-tenant web application. Our tenants will be using Windows Azure Active Directory for authentication. We are using OWIN OpenIdConnect middleware to authenticate users. The response we receive after authentication process has id_token and authorization code. We also want to get the refresh token so that we can acquire new tokens once the id_token expires. Therefore in AuthorizationCodeReceived handler we use AcquireTokenByAuthorizationCode method in ADAL library to acquire the refresh token. The response contains id_token, access_token and refresh_token. We then

How are OwinContext.Request.Path and PathBase populated?

懵懂的女人 提交于 2019-12-05 17:46:52
问题 I'm writing my own OWIN middleware for OpenID Connect authorization code flow, based on other examples in the Katana Project. As part of this I have to construct a couple of URIs, eg a Redirect URI and a Return URL. Other examples in Katana do this by concatenating parts from the current request, for example in CookieAuthenticationHandler loginUri = Request.Scheme + Uri.SchemeDelimiter + Request.Host + Request.PathBase + Options.LoginPath + new QueryString(Options.ReturnUrlParameter,

How do you reject a Katana Bearer token's identity

会有一股神秘感。 提交于 2019-12-05 15:33:52
How can I reject An identity? My class inherits from OAuthBearerAuthenticationProvider and I have an override of ValidateIdentity? I have tried setting context.Rejected(); or context.SetError(); and throwing an exception but my controllers still get called. OAuthBearerAuthenticationHandler does call my class so I know I have the setup correct. my current failing code public void ConfigureAuth ( IAppBuilder app ) { // Enable the application to use a cookie to store information for the signed in user // and to use a cookie to temporarily store information about a user logging in with a third

Websockets using OWIN

最后都变了- 提交于 2019-12-05 15:21:23
问题 All the examples using Microsoft WebSockets over a web-api that I've seen so far use IIS, the implementation is on the get method the HTTP connection is upgraded to a websocket and an instance of websocket handler is passed to the HTTPContext public HttpResponseMessage Get() { if (HttpContext.Current.IsWebSocketRequest) { var noteHandler = new NoteSocketHandler(); HttpContext.Current.AcceptWebSocketRequest(noteHandler); } return new HttpResponseMessage(HttpStatusCode.SwitchingProtocols); }