0

I am creating an application using React-Native and an asp.net core 6 API. I have registered both applications on Azure. When making a request from my Client Application for an access token, the request succeeds with a valid JWT according too jwt.io. However, I am recieving an error from my API that the token's signature is invalid. FYI I am also using version 2 of the token endpoints and I am logging in through a emulate android device. Not sure where to go from here.

Error enter image description here

Client Code

  const retrieveWorkouts = (accessToken:string) => {
    fetch(`${API_URL}/api/workout`, 
    {
        method: 'GET',
        headers: {
            Authorization: `Bearer ${accessToken}`,
            "Content-Type": "application/json"
        }
    })
    .then(response => {
        console.log(response)
        if(response.ok) {
            return response.json()
        }
    })
    .then(data => { 
        setWorkouts([...data])})
    .catch(error => {
        console.log(error)
    });
  }

1 Answer 1

0

So after a lot of reading through the Microsoft documentation, I learned more about Active Directory. The issue was with the Tenant I was using. My API was using my schools directory and when I tried to access my API it couldn't because the login account I was using was not a tenant in my school's directory.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.