Please provide the following:
- SDK Version: “expo”: “~47.0.12”,
- Platforms(Android/iOS/web/all): web and ios
So I have set up an Azure AD B2C tenant with an App Registration.
I have the following code, taken from the Azure expo-auth-session
docs.
WebBrowser.maybeCompleteAuthSession();
const Authenticated = () => {
const discovery = AuthSession.useAutoDiscovery(
"https://testtenantname.b2clogin.com/tfp/testtenantname.onmicrosoft.com/B2C_1_weatherappflow"
);
console.log("discovery is: ", discovery);
const [request, response, promptAsync] = AuthSession.useAuthRequest(
{
clientId: "24c9fd0c-f595-485d-8aa1-2e782d45b104",
scopes: ["api://62bc39a4-f689-4bb1-a1ae-1763d6f17539/Read.Weather"],
redirectUri: "http://localhost:19006"
},
discovery
);
useEffect(() => {
console.log("Received the following response: ", response);
}, [response]);
return (
<Button
disabled={!request}
title="Login"
onPress={() => {
promptAsync();
}}
/>
);
};
No matter whether I try it with ios (I replace the redirectUri for that) or try it with the web version, I get the same error saying
AADB2C90012: The scope 'api://62bc39a4-f689-4bb1-a1ae-1763d6f17539/Read.Weather' provided in request is not supported. Correlation ID: 56f3a68a-72a2-4d68-8943-6b2709d1cb06
I have confirmed multiple times that the permission is there for the App registration → API permissions → the permission is there and the admin consent is granted
I have also tried switching around requesting scope: read.weather
, offline_access
always the same error.
What am I doing wrong? I have read a lot of Azure docs to see how they set up their App registrations, and that seems to be correct, so I assume I am using the library in a wrong way, but I dont see what is the issue?
Can somone please help me with this as I am on the edge of insanity