# Login to Headless Wordpress via AUTH0

**URL:** <https://community.auth0.com/t/login-to-headless-wordpress-via-auth0/167444>\
**Category:** Get Help\
**Tags:** authentication-sessions, sessions\
**Created:** [January 4, 2025, 8:50pm UTC](https://community.auth0.com/t/login-to-headless-wordpress-via-auth0/167444 "2025-01-04T20:50:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![branislav.meandzija](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/branislav.meandzija/32/69886_2.png) [@branislav.meandzija](https://community.auth0.com/u/branislav.meandzija)\
**Post date:** [January 4, 2025, 8:50pm UTC](https://community.auth0.com/t/login-to-headless-wordpress-via-auth0/167444/1 "2025-01-04T20:50:33Z")

</div>

Hello Community,

i am building headless woocommerce solution that is using Auth0 for authentication, on Vercel/Next.js/React side of app i have added a login button that redirect to my tenant login which when you successfully login redirects back to the App with user info from auth0 and i have established session with auth0.

On the CMS side i have Wordpress/Woocommerce which has Auth0 plugin installed and also app connection between auth0 and wordpress/woocommerce part is established, when you visit sitename/wp-admin and you have session from auth0 you would be instant logged in.

Now what i am currently missing is session with woocommerce in app, i am using graphql requests which require session token and auth token from woocommerce, how do i retrieve that once i am logged in auth0 and have active session there? So the flow would be to go to Vercel app click login button → redirect to tenant @ authcom → redirect back to Vercel app once logged successfully on auth0 → session established with Woocommerce too so i can send further correct requests to WP.

---

<div class="post-metadata">

**Author:** ![gerald.czifra](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gerald.czifra/32/75301_2.png) [@gerald.czifra](https://community.auth0.com/u/gerald.czifra)\
**Post date:** [January 16, 2025, 12:07am UTC](https://community.auth0.com/t/login-to-headless-wordpress-via-auth0/167444/3 "2025-01-16T00:07:48Z")

</div>

Hi @branislav.meandzija

Thank you for reaching out!  
Reading through your post, I’m wondering if the `wp_get_session_token(): string` function is not the missing piece in the puzzle. Based on this [documentation](https://developer.wordpress.org/reference/functions/wp_get_session_token/) from WordPress, it is used to retrieve the current session token from the logged\_in cookie.

Let me know if this helped!  
Gerald

---

<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:** [January 30, 2025, 12:08am UTC](https://community.auth0.com/t/login-to-headless-wordpress-via-auth0/167444/4 "2025-01-30T00:08:15Z")

</div>

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