Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Descope Reactnative Redirect URI not recognized in production #22

Open
wuxiaohua1011 opened this issue Aug 18, 2024 · 0 comments
Open

Comments

@wuxiaohua1011
Copy link

I followed the tutorial on https://docs.expo.dev/guides/authentication/#descope. It says that i can use the below for redirectURI

const redirectUri = AuthSession.makeRedirectUri();

it does work when I run the app using npx expo start

However, when I submit to app store, it just says

{"errorCode":"E011003","errorDescription":"Request is invalid","errorMessage":"The redirect_uri field must have a hostname","message":"The redirect_uri field must have a hostname"}

Below is my code

const descopeProjectId = "xxxxxx";
const descopeUrl = `https://api.descope.com/${descopeProjectId}`;
const redirectUri = AuthSession.makeRedirectUri();

export default function SignupOrLogin() {
    const [authTokens, setAuthTokens] = React.useState(null);
    const [userInfo, setUserInfo] = React.useState(null);
    const discovery = AuthSession.useAutoDiscovery(descopeUrl);
    const [userProfile, setUserProfile] = useState<UserProfile>({} as UserProfile)

    const [request, response, promptAsync] = AuthSession.useAuthRequest(
        {
            clientId: descopeProjectId,
            responseType: AuthSession.ResponseType.Code,
            redirectUri,
            usePKCE: true,
            scopes: ["openid", "profile", "email"],
        },
        discovery
    );

I have attempted to search online for something else, but I'm not quite sure what to substitude for redirectUri.

Thanks a lot for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant