Get User details from Zero Trust Login
if i protect a self hosted website with zero trust and a user logs in with his email, how can i display the user profile details from a database from the self hosted website? with php and js
2 Replies
if the application is in zero trust there will be session data in the form of a cloudflare jwt token. your application just needs to read that http header
check out https://developers.cloudflare.com/cloudflare-one/identity/authorization-cookie/
Cloudflare Docs
Authorization cookie · Cloudflare Zero Trust docs
When you protect a site with Cloudflare Access, Cloudflare checks every HTTP request bound for that site to ensure that the request has a valid CF_Authorization cookie. If a request does not include the cookie, Access will block the request.
since you can pull the email address from that token you should be able to identify your users in your database to present their information