Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Ios app auth crashes when it comes to authorize

Open
#1,069 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
15/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
javascript, react-native

Research direction

Start by reproducing the iOS login flow around the shown authorize({ ...Config, connectionTimeoutSeconds: 5, iosPrefersEphemeralSession: true }) call. Confirm the identity provider, iOS platform details, React Native and react-native-app-auth versions, and the crash output; done means the authorization flow no longer crashes and the relevant error is covered.

Written by the indexing model from the issue text.

Description

Issue

---login: async () => {
console.log("AAD injected sign in");
console.log("Config:", Config);

    try {
        console.log(authorize, "Attempting to authorize...");  
        const payload = await authorize({
            ...Config,
            connectionTimeoutSeconds: 5,
            iosPrefersEphemeralSession: true,
        });//await authorize(Config);
        console.log("Authorization successful:", payload);

        if (payload?.accessToken) {
            console.log("Storing access token...");
            await AsyncStorage.setItem('accessToken', payload.accessToken);
        }
        if (payload?.refreshToken) {
            console.log("Storing refresh token...");
            await AsyncStorage.setItem('refreshToken', payload.refreshToken);
        }

        console.log("Returning payload...");
        return payload;
    } catch (error) {
        console.error("Error during login:", error);
        throw error;
    }
},
logout: async () => {
    console.log("AAD injected sign out");
    authorize(LogoutConfig);
    return Promise.resolve();
},
refreshToken: async () => {
    const refreshToken = await AsyncStorage.getItem('refreshToken');

    if (refreshToken) {
        const payload = await refresh(Config, {
            refreshToken
        });

        await AsyncStorage.setItem('accessToken', payload?.accessToken);
        await AsyncStorage.setItem('refreshToken', payload?.refreshToken);
        console.log("refreshToken", payload);
        
        return payload;
    } else {
        return Promise.resolve();
    }
},
getToken: async () => {
    return AsyncStorage.getItem('accessToken')
}

Environment

  • Your Identity Provider: e.g. Ping fed
  • Platform that you're experiencing the issue on: iOS / Android / both
  • Your react-native Version: e.g. 0.69.12
  • Your react-native-app-auth Version: e.g. 8.0.2
  • Are you using Expo? no
Dominant language
Java
Stars
2.3k
Forks
473
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FormidableLabs/react-native-app-auth

All issues in FormidableLabs/react-native-app-auth

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.