# Login via Postman on a .net core 3 app using Auth0

**URL:** <https://community.auth0.com/t/login-via-postman-on-a-net-core-3-app-using-auth0/39246>\
**Category:** Get Help\
**Tags:** net-core, aspnet-core, postman\
**Created:** [March 12, 2020, 1:28am UTC](https://community.auth0.com/t/login-via-postman-on-a-net-core-3-app-using-auth0/39246 "2020-03-12T01:28:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vics](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vics/32/12799_2.png) [@vics](https://community.auth0.com/u/vics)\
**Post date:** [March 12, 2020, 1:28am UTC](https://community.auth0.com/t/login-via-postman-on-a-net-core-3-app-using-auth0/39246/1 "2020-03-12T01:28:43Z")

</div>

I have a .net app with login setup via Auth0 (works fine with user interaction) but I want to login with a script with no user interaction, which isn’t working. Basically I want to run a LogicApp or some script with hard coded user/pass at night that access a page inside my app.

I’ve tried Azure LogicApps and Postman with the same results. I try to access a page inside my app by passing user/password as basic auth. I get a few redirects and back to the signin page. Auth0 is no providing any logs, so I assume the authentication is not reaching Auth0.

Obs1: I had this setup that I’m sure was working about 6 months ago, just recently I realized that it had stopped working, could’ve been a change in Auth0 or due to migrating from .net core 2.1 to 3.

Obs2: I also started testing the login with a Bearer token, but there will be too many changes in the code that I want to leave this as plan b.

**Snippet of Startup.cs**

> services.Configure(options =\>‘’’  
> {  
> options.CheckConsentNeeded = context =\> true;  
> options.MinimumSameSitePolicy = SameSiteMode.None;  
> options.Secure = CookieSecurePolicy.Always;  
> });
> 
> // Add authentication services  
> services.AddAuthentication(options =\>  
> {  
> options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme;  
> options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;  
> options.DefaultChallengeScheme = CookieAuthenticationDefaults.AuthenticationScheme;  
> })  
> .AddCookie()  
> .AddOpenIdConnect(“Auth0”, options =\>  
> {  
> // Set the authority to your Auth0 domain  
> options.Authority = $“[https://login.myapp.net](https://login.myapp.net)”;
> 
> // Configure the Auth0 Client ID and Client Secret  
> options.ClientId = "_**";  
> options.ClientSecret = "**_\*\*\*\*\*\*\*;
> 
> //Set response type to code  
> options.ResponseType = “code”;
> 
> // Configure the scope  
> options.Scope.Clear();  
> options.Scope.Add(“openid”);  
> options.Scope.Add(“profile”);  
> options.Scope.Add(“email”);
> 
> //Set the correct name claim type  
> options.TokenValidationParameters = new TokenValidationParameters  
> {  
> NameClaimType = “name”,  
> RoleClaimType = “[https://schemas.myapp.net](https://schemas.myapp.net)”  
> };
> 
> // Set the callback path  
> options.CallbackPath = new PathString(“/callback”);
> 
> // Configure the Claims Issuer  
> options.ClaimsIssuer = “Auth0”;

**Postman result (3 redirects and a found - login page):**

> GET [https://myapp.net/](https://myapp.net/)  
> 302
> 
> GET [https://myapp.net/Account%2FLogin](https://myapp.net/Account%2FLogin)  
> 302
> 
> GET [https://login.myapp.net/authorize?client\_id=\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*&redirect\_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response\_type=code&scope=openid%20profile%20email&code\_challenge=\*\*\*\*\*\*\*\*\*\*\*&code\_challenge\_method=S256&response\_mode=form\_post&nonce=\*\*\*\*\*&x-client-SKU=ID\_NETSTANDARD2\_0&x-client-ver=5.5.0.0](https://login.myapp.net/authorize?client_id= ****************&redirect_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response_type=code&scope=openid%20profile%20email&code_challenge=*********** &code_challenge_method=S256&response_mode=form_post&nonce= ***** &x-client-SKU=ID_NETSTANDARD2_0&x-client-ver=5.5.0.0)  
> 302
> 
> GET [https://login.myapp.net/login?state=\*\*\*\*\*\*\*\*\*\*\*&protocol=oauth2&redirect\_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response\_type=code&scope=openid%20profile%20email&code\_challenge=\*\*\*\*\*\*\*\*\*&code\_challenge\_method=S256&response\_mode=form\_post&nonce=\*\*\*\*\*\*\*\*\*\*\*\*\*&x-client-SKU=ID\_NETSTANDARD2\_0&x-client-ver=5.5.0.0](https://login.myapp.net/login?state= ***********&protocol=oauth2&redirect_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response_type=code&scope=openid%20profile%20email&code_challenge=********* &code_challenge_method=S256&response_mode=form_post&nonce= ************* &x-client-SKU=ID_NETSTANDARD2_0&x-client-ver=5.5.0.0)  
> 200  
> 197ms  
> ▼  
> Request Headers  
> Authorization: Basic \*\*\*\*\*\*\*\*\*\*  
> User-Agent: PostmanRuntime/7.22.0  
> Accept: _/_  
> Cache-Control: no-cache  
> Postman-Token: \*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> Accept-Encoding: gzip, deflate, br  
> Cookie: did=_ **; auth0\_compat=** _\*\*  
> Referer: [https://login.myapp.net/authorize?client\_id=\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*&redirect\_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response\_type=code&scope=openid%20profile%20email&code\_challenge=\*\*\*\*\*\*\*\*\*\*\*&code\_challenge\_method=S256&response\_mode=form\_post&nonce=\*\*\*\*\*\*&state=\*\*\*\*\*\*\*\*\*\*\*\*\*&x-client-SKU=ID\_NETSTANDARD2\_0&x-client-ver=5.5.0.0](https://login.myapp.net/authorize?client_id= ***************&redirect_uri=https%3A%2F%2Fapp.myapp.net%2Fcallback&response_type=code&scope=openid%20profile%20email&code_challenge=*********** &code_challenge_method=S256&response_mode=form_post&nonce= ******&state=************* &x-client-SKU=ID_NETSTANDARD2_0&x-client-ver=5.5.0.0)  
> Connection: keep-alive  
> Response Headers  
> Server: nginx  
> Date: Wed, 11 Mar 2020 04:18:29 GMT  
> Content-Type: text/html; charset=utf-8  
> Transfer-Encoding: chunked  
> Connection: keep-alive  
> Vary: Accept-Encoding  
> ot-tracer-spanid: 6ed01af3e  
> ot-tracer-traceid: 3d5f35a407  
> ot-tracer-sampled: true  
> X-Auth0-RequestId: 655374d6432978  
> X-RateLimit-Limit: 1000  
> X-RateLimit-Remaining: 999  
> X-RateLimit-Reset: 1583900310  
> set-cookie: \_csrf=eML8VgsIOn-ONcU0u3TeTx7U; Max-Age=864000; Path=/usernamepassword/login; HttpOnly; Secure  
> X-Robots-Tag: noindex, nofollow  
> X-Robots-Tag: noindex, nofollow, nosnippet, noarchive  
> X-Frame-Options: deny  
> Content-Security-Policy: frame-ancestors ‘none’  
> X-XSS-Protection: 1; mode=block  
> X-Content-Type-Options: nosniff  
> Referrer-Policy: same-origin  
> ETag: W/“a6e-Dn+oh0+jgssgYbnM4PE”  
> cache-control: private, no-store, no-cache, must-revalidate, post-check=0, pre-check=0, no-transform  
> Content-Encoding: gzip  
> Strict-Transport-Security: max-age=15768000  
> ▼  
> Response Body  
> [sign in page]

---

<div class="post-metadata">

**Author:** ![vics](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vics/32/12799_2.png) [@vics](https://community.auth0.com/u/vics)\
**Post date:** [March 13, 2020, 3:00pm UTC](https://community.auth0.com/t/login-via-postman-on-a-net-core-3-app-using-auth0/39246/2 "2020-03-13T15:00:14Z")

</div>

I managed to make it work. Since I’m using cookie authentication I had to enable the interceptor feature in postman to grab the auth cookie from the browser.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 28, 2020, 3:00pm UTC](https://community.auth0.com/t/login-via-postman-on-a-net-core-3-app-using-auth0/39246/3 "2020-03-28T15:00:15Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
