FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Register a user with FormidableLabs/react-native-app-auth

    Scheduled Pinned Locked Moved Solved
    Q&A
    1
    2
    670
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mark.robustelliM
      mark.robustelli
      last edited by

      Is there a way to register a user using FormidableLabs/react-native-app-auth?

      mark.robustelliM 1 Reply Last reply Reply Quote 0
      • mark.robustelliM
        mark.robustelli @mark.robustelli
        last edited by mark.robustelli

        So, to call the user registration form, one just needs to:

        • Remove any calls to prefetchConfiguration()
        • Pass every needed URL (authorize, token and logout endpoints) to a serviceConfiguration object
        • Call the authorize() method but use the custom /oauth2/register endpoint
          Here's a sample code:
        // Configuring FusionAuth
        const fusionAuthConfig = {
          issuer: "your.fusionauth.url",
          clientId: "Your application's Client Id",
          redirectUrl: "com.your.app://oauthredirect",
          scopes: ["openid", "offline_access"],
          serviceConfiguration: {
            authorizationEndpoint: "https://your.fusionauth.url/oauth2/authorize",
            userRegisterEndpoint: "https://your.fusionauth.url/oauth2/register", // This will be used down below
            tokenEndpoint: "https://your.fusionauth.url/oauth2/token",
            endSessionEndpoint: "https://your.fusionauth.url/oauth2/logout",
          },
        };
        
        // And then, in your component, replace the URL in authorizationEndpoint
        // with the one in userRegisterEndpoint and call authorize()
        const config = {...fusionAuthConfig, ...{
          serviceConfiguration: {
           ...fusionAuthConfig.serviceConfiguration,
            authorizationEndpoint: fusionAuthConfig.serviceConfiguration.userRegisterEndpoint,
          },
        }};
        const authState = await authorize(config);
        

        More detail can be found here: https://github.com/FusionAuth/fusionauth-issues/issues/2435

        1 Reply Last reply Reply Quote 0
        • mark.robustelliM mark.robustelli has marked this topic as solved on
        • First post
          Last post