owin

ASP.net Identity Custom Tables using OwinContext

柔情痞子 提交于 2019-12-13 05:09:59
问题 I'm trying to implement custom tables to store users/roles etc. in a SQL server DB using Entity framework 6. I've create a base DbContext that derives from IdentityDbContext public class MainContext : IdentityDbContext<ApplicationUser> { public MainContext() : base("name=Main") { } public static MainContext Create() { return new MainContext(); } } I also have a custom user class that inherits IdentityUser public class ServiceUser : IdentityUser{ } In the ConfigureAuth the defualt code was:

JWT token isn't validated even if it's correct using Microsoft.Azure.Mobile SDK

删除回忆录丶 提交于 2019-12-13 05:02:32
问题 I'm using Microsoft.Azure.Mobile SDK for implementing Server code. Code in OWIN startup is as below: public void ConfigureAuth(IAppBuilder app) { HttpConfiguration config = new HttpConfiguration(); new MobileAppConfiguration().ApplyTo(config); app.UseAppServiceAuthentication(new AppServiceAuthenticationOptions { SigningKey = ConfigurationManager.AppSettings["SigningKey"], ValidAudiences = new[] { ConfigurationManager.AppSettings["ValidAudience"] }, ValidIssuers = new[] { ConfigurationManager

Self hosting Web API with OWIN on EC2

心不动则不痛 提交于 2019-12-13 04:42:05
问题 I followed step-by-step instructions from http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api. Here is the code of console application: namespace OWINTest { class Program { static void Main(string[] args) { string baseAddress = "http://localhost:1961/"; // Start OWIN host WebApp.Start<Startup>(url: baseAddress); ... } } class Startup { // This code configures Web API. The Startup class is specified as a type // parameter in the WebApp.Start method. public

Problems adding insights to Owin based project

萝らか妹 提交于 2019-12-13 04:27:19
问题 I have been trying to add Azure application insights to a few projects. The whole experience was seamless with a .net core app. However, when I tried to update the Cloud role name property, that is where I could not find a lot for an OWIN based app. I want the name of the bubble in Insights Application Map to appear what I set in this property (My API for example) but it keeps resorting to the resource name that I have for this resource in Azure (my-azure-api). After scouring through most

IDX10503: Signature validation failed after updating to Owin.Security v 4.0.0

江枫思渺然 提交于 2019-12-13 04:13:58
问题 As per subject, I updated the Owin.Security.WsFederation and dependent packages to version 4.0 and I get the error. I did not make any code changes other than changing using Microsoft.IdentityModel.Protocols; to using Microsoft.IdentityModel.Protocols.WsFederation; where is the WsFederationConfiguration class seems to be now. Here is my StartupAuth : public void ConfigureAuth(IAppBuilder app) { app.UseCookieAuthentication( new CookieAuthenticationOptions { AuthenticationType =

Need help in modifying OWIN (Katana) for running VS2013's MVC WebApplication in Raspberry Pi

跟風遠走 提交于 2019-12-13 03:51:42
问题 I want to run Visual Studio 2013's default MVC WebApplication in Raspberry Pi 2. I managed to install mono 4.0.1 and Lighttpd as the web server, and I was able to get this default MVC WebApplication (with no authentication) run on the Raspberry machine. However, when I tried the same MVC WebApplication but with "Individual Authentication", it gives the following error: System.MissingMethodException: Method 'HttpApplication.RegisterModule' not found. After googling, I found it here that this

Why MVC handler didn't execute after IAppBuilder.Run method invoked?

大憨熊 提交于 2019-12-13 03:36:35
问题 In MVC5, which integrated with OWIN(Katana) via Microsoft.Owin.Host.SystemWeb.dll, why MVC handler didn't execute after IAppBuilder.Run method invoked, and did execute after IAppBuilder.Use method invoked? Here are my implementations: Case 1: public partial class Startup { public void Configuration(IAppBuilder app) { app.Use( async (context, next) => { await context.Response.WriteAsync(@"<h1>Before MVC</h1>"); await next.Invoke(); //What 's the "next" object now? await context.Response

owin self-host with windows authentication - AllowAnonymous not working

北城以北 提交于 2019-12-13 03:09:58
问题 I've enabled Windows authentication as described here It all works fine, there's just a tiny issue: Doing so makes every controller method protected by windows authentication. NO problem I thought, just use the [AllowAnonymous] adorner on the few controller methods where anonymous access is okay, but that won't work. Is there any way to get the self-host to not authorized every method on every controller? 回答1: You have to enable Windows auth and anonymous auth. documentation. As is, you have

OwinMiddleware Authentication (ws federation) - MVC5 Identity 2 - IDX10201: None of the the SecurityTokenHandlers could read the 'securityToken'

淺唱寂寞╮ 提交于 2019-12-13 02:04:32
问题 I'm trying to Authenticate toward an ACS server, I do manage to get authenticated with http modules the old way through the config file but I can't git it to work with owin. Here is the relevants part of my startup app.UseCookieAuthentication( new CookieAuthenticationOptions { AuthenticationType = WsFederationAuthenticationDefaults.AuthenticationType }); app.UseWsFederationAuthentication( new WsFederationAuthenticationOptions { MetadataAddress = "https://*******.accesscontrol.windows.net

When calling AcquireTokenByRefreshToken on the AuthenticationContext instance with Microsoft.IdentityModel.Clients.ActiveDirectory?

大憨熊 提交于 2019-12-13 01:13:19
问题 I am developing a multi-tenant application registered on my Azure AD that consumes Office 365 apis, Graph API etc. I followed this Microsoft sample to build my work which uses ADAL .NET library and OpenIdConnect: Microsoft.IdentityModel.Clients.ActiveDirectory, Version=2.19.0.0 In ADAL.NET, we use an AuthenticationContext instance with a custom inherited class for the TokenCache (see code the sample code here). For each request to the authorized resources, depending on the API, we invoke one