# .Net CORE + Keycloak by OIDC not work

**URL:** <https://forum.keycloak.org/t/net-core-keycloak-by-oidc-not-work/1873>\
**Category:** Securing applications\
**Created:** [March 29, 2020, 9:58pm UTC](https://forum.keycloak.org/t/net-core-keycloak-by-oidc-not-work/1873 "2020-03-29T21:58:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dudod](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@Dudod](https://forum.keycloak.org/u/Dudod)\
**Post date:** [March 29, 2020, 9:58pm UTC](https://forum.keycloak.org/t/net-core-keycloak-by-oidc-not-work/1873/1 "2020-03-29T21:58:09Z")

</div>

Hi all!

I tried to create .Net Core 3.1 Web API witch used Keycloak authorization. I want to implement next scenario:

1. Browser send some request to api.  
1\*. If user isn’t authenticated, Api redirect to Keycloak login page.
2. Api check auth.
3. Api send response.

But it doesn’t work(

Into step 2 I have System.Exception: Correlation failed.  
at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler.  
As far, as I understand, it’s part of openId witch protect from login CSRF attack, and it’s cookies based. I think, problem was in cookie witch I marked red in net logs, and it wasn’t in Keycloak response.

My question is: How make Keycloak to return all sended cookies? I think it is some option, but I couldn’t find it.

 ![Screenshot 2020-03-30 at 00.53.29](https://global.discourse-cdn.com/free1/uploads/keycloak/original/1X/fda1ff158662801235edd8e4504e7842ab62b3e2.png)
