# Web API backend React frontend

**URL:** <https://community.auth0.com/t/web-api-backend-react-frontend/183489>\
**Category:** Get Help\
**Tags:** login-experience, new-universal-login-experience\
**Created:** [March 6, 2025, 9:34pm UTC](https://community.auth0.com/t/web-api-backend-react-frontend/183489 "2025-03-06T21:34:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gbedford45](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/gbedford45/32/73489_2.png) [@gbedford45](https://community.auth0.com/u/gbedford45)\
**Post date:** [March 6, 2025, 9:34pm UTC](https://community.auth0.com/t/web-api-backend-react-frontend/183489/1 "2025-03-06T21:34:12Z")

</div>

Ready to post? 🔍 First, try searching for your answer.  
I wanted to keep as little as possible on my react frontend.

builder.Services.AddAuth0WebAppAuthentication(options =\>  
{  
options.Domain = “xxxxxxxxxxxx”;  
options.ClientId = “xxxxxxxxxx”;  
options.ClientSecret = “xxxxxx…”;  
});;

My frontend just makes calls to Login:

```auto
 [HttpGet("login")]
 public IActionResult Login(string returnUrl = "/")
 {
     var authenticationProperties = new LoginAuthenticationPropertiesBuilder()
     .WithRedirectUri("/api/auth/callback")
     .WithScope("openid profile email")
     .Build();

     return Challenge(authenticationProperties, Auth0Constants.AuthenticationScheme);
 }

```

```auto

        [HttpPost("callback"), HttpGet("callback")]
        [AllowAnonymous]
        public async Task<IActionResult> Callback()
        {
            var authResult = await HttpContext.AuthenticateAsync(Auth0Constants.AuthenticationScheme);
            if (!authResult.Succeeded) return Unauthorized();

            var claims = authResult.Principal?.Identities.FirstOrDefault()?.Claims;

            
            return Redirect("reactwebapp"); 
        }

```

Here I just redirect back to my frontend. I’ve gotten it to work up to this point but I am fairly new to this, so I am not sure where to go from here. I basically just want my frontend to have a token that it can feed with subsequent calls and wanted to make sure that I’m even moving the right direction.

---

<div class="post-metadata">

**Author:** ![vlad.murarasu](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vlad.murarasu/32/72793_2.png) [@vlad.murarasu](https://community.auth0.com/u/vlad.murarasu)\
**Post date:** [March 7, 2025, 5:47pm UTC](https://community.auth0.com/t/web-api-backend-react-frontend/183489/3 "2025-03-07T17:47:53Z")

</div>

Hi @gbedford45,

Welcome to the Auth0 Community!

After successful authentication, in the `authResult.Properties` you can call the `GetTokens()` method and send the tokens you need back to the client. Any subsequent API requests that need authorization will need these tokens.

If you have any other questions feel free to ask us.

Have a good one,  
Vlad

---

<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 21, 2025, 5:48pm UTC](https://community.auth0.com/t/web-api-backend-react-frontend/183489/4 "2025-03-21T17:48:26Z")

</div>

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