owin

MVC - Mixed Auth - OWIN + Windows Auth

穿精又带淫゛_ 提交于 2019-12-29 13:11:57
问题 I need to have both windows authentication and owin (forms) authentication but i can't get it to work. Probably the best option is to have two sites that have different authentication methods. I found a project that does what i want: MVC5-MixedAuth. But it uses IISExpress and i can't get it to work with Local IIS. The error that occurs is: Request filtering is configured on the Web server to deny the request because the query string is too long. If i remove all my ConfigureAuth() method

MVC - Mixed Auth - OWIN + Windows Auth

人盡茶涼 提交于 2019-12-29 13:10:01
问题 I need to have both windows authentication and owin (forms) authentication but i can't get it to work. Probably the best option is to have two sites that have different authentication methods. I found a project that does what i want: MVC5-MixedAuth. But it uses IISExpress and i can't get it to work with Local IIS. The error that occurs is: Request filtering is configured on the Web server to deny the request because the query string is too long. If i remove all my ConfigureAuth() method

change facebook redirect_uri web api

家住魔仙堡 提交于 2019-12-29 08:54:16
问题 I was wondering if someone could give me a hand or point me in the right direction. I've setup facebook social sign in within my web api 2 project and it works correctly. However, when I deploy it to production I have found that the redirect_uri is showing HTTP instead of HTTPS and this causes the service to crash. What I wanted to know was firstly how the redirect_uri is constructed and whether there was any way of updating it. The whole reason this is happening is because of our load

How to pass Owin context to a Repo being injected into Api controller

你离开我真会死。 提交于 2019-12-28 12:05:34
问题 I've got a MVC WebApi owin (soft hosted) project, that uses Unity for resolving controller dependencies which look like this public class PacientaiController : ODataController { private readonly IEntityRepo<Ent.Pacientas> repo; public PacientaiController(IEntityRepo<Ent.Pacientas> repo) { this.repo = repo; } the problem I'm trying to solve - is how do I pass 'OwinContex' into a Repo. public class PacientasEntityRepo:IEntityRepo<Pacientas>,IDisposable { public PacientasEntityRepo(IOwinContext

Can't find Request.GetOwinContext

喜夏-厌秋 提交于 2019-12-28 09:32:07
问题 I have been searching for an hour trying to figure out why this isn't working. I have a ASP.Net MVC 5 application with a WebAPI. I am trying to get Request.GetOwinContext().Authentication, however I can't seem to find how to include GetOwinContext. Here is my code: using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Net.Http; using System.Web; using System.Web.Mvc; using System.Web.Security; using TaskPro.Models; namespace TaskPro.Controllers.api

MVC 5 Owin Facebook Auth results in Null Reference Exception

为君一笑 提交于 2019-12-28 02:51:08
问题 I'm trying to setup integrated OWIN Facebook authentication in a new MVC 5 project in Visual Studio 2013. I have configured apps and keys as per this tutorial: http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on However, I'm getting a NullReferenceException thrown from this call in the AccountController: [AllowAnonymous] public async Task<ActionResult> ExternalLoginCallback(string returnUrl) { var loginInfo = await

Can't figure out if OWIN is intercepting requests to api from client

心已入冬 提交于 2019-12-25 16:46:07
问题 I have an Asp.net webapi with JWT authentication using OWIN middle ware. My resource server and the authorization server are same. I am able to get the token from the token endpoint. ValidateClientAuthentication and GrantResourceOwnerCredentials methods are hit successfully. However when I try to access a protected(with [Authorize]) api (with authorization header set to bearer token) I only get "Authorization has been denied for this request". I have overridden ValidateAuthorizeRequest method

OwinMiddleware implementation in Resource Server suppresses Token validation

大城市里の小女人 提交于 2019-12-25 14:47:45
问题 I have set up my Resource Server (Web Api 2) to validate JWT token for incoming requests. The JWT token is issued by Auth0 and my client pass it to my web api. This all works fine and raises 401 response if Issuer, Audience or Expiry date is not valid. When I add my custom middleware derived from OwinMiddleware it suppresses token validation logic and I get 200 response for invalid requests. public class Startup { public void Configuration(IAppBuilder app) { var issuer = "my issuer"; var

Redirect other then Home/Index using OpenIdConnectAuthentication and Identity server after login

自古美人都是妖i 提交于 2019-12-25 14:24:33
问题 I'm trying to Redirect user to Dashboard but it always redirect it to Home/Index that is because I've set RedirectUri to http://localhost:35641/ in Identity Server Options. But that is true in case of application landing page after login it needs to redirect o dashboard. I can write custom logic in Index's Action Result but I want to avoid it. MVC web Startup method public void Configuration(IAppBuilder app) { // Implicit mvc owin JwtSecurityTokenHandler.InboundClaimTypeMap = new Dictionary

Multiple users same browser asp identity

流过昼夜 提交于 2019-12-25 09:57:51
问题 We have an application which has two user types. One of them is an administrator and the other one is a client. We are using AspNet identity to authenticate the user and issue a cookie. However, there is a scenario where the administrator and the user share the same browser. When the client logs in, the cookie gets overridden and when coming back to the administrator pages we lose authentication. The same happens the other way around (client is logged in first, then admin). Is there a way to