title: React Native: Google OAuth Invalid parameter value for redirect_uri: Invalid scheme
body: <p>I have some problems with authentication with Google OAuth2 in my react-native app. I'm using 'expo-auth-session' library for my authentification. I need get access token and then get Youtube profile. But i'm stuck with error &quot;Invalid parameter value for redirect_uri: Invalid scheme&quot;</p>
  <p>My scheme in app.json:</p>
  <pre><code>&quot;scheme&quot;: &quot;com.liga.online&quot;
  </code></pre>
  <p>My code is below:</p>
  <pre><code>import {
    makeRedirectUri,
    useAuthRequest,
    ResponseType,
  
  } from &quot;expo-auth-session&quot;;
  
  const discoveryYoutube = {
      authorizationEndpoint: 'https://accounts.google.com/o/oauth2/v2/auth',
      tokenEndpoint: 'https://oauth2.googleapis.com/token',
      revocationEndpoint: 'https://oauth2.googleapis.com/revoke'
  };
  
  
  /// Inside my React component
  const [requestYoutube, responseYoutube, promptAsyncYoutube] = useAuthRequest(
      {
        responseType: ResponseType.Code,
        clientId: YOUTUBE_CLIENT_ID,
        scopes: [&quot;https://www.googleapis.com/auth/youtube.readonly&quot;],
        redirectUri: makeRedirectUri({
          native: &quot;com.liga.online/callback&quot;,
        }),
      },
      discoveryYoutube
    );
  </code></pre>
  <p>When I press the button, callback is starting</p>
  <pre><code>  const signInYoutube = async () =&gt; {
      const response = await promptAsyncYoutube();
      console.log(response.data);
    }
  </code></pre>
  <p>But I get error<a href="https://i.stack.imgur.com/gv5x8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gv5x8.png" alt="enter image description here" /></a></p>
  <p>Any idea how I can fix it?</p>
  <p>P.S. I tried fix it with library &quot;expo-google-app-auth&quot;. I get access token, but when I try to get Youtube profile and get &quot;Request failed with status code 403&quot;.</p>
  <p><strong>UPDATE 1</strong></p>
  <p>By the way about my connection to Youtube Profile.</p>
  <p>I change something to get access token.</p>
  <p>For example:</p>
  <pre><code>import * as Google from 'expo-google-app-auth';
  import { startAsync } from 'expo-auth-session';
  
  
  // Inside my React component
  
  // When I press the button, callback is starting
  
  const signInYoutube = async () =&gt; {
  
      const config = {
          androidClientId: YOUTUBE_CLIENT_ID
      };
  
      const { type, accessToken, user } = await Google.logInAsync(config);
  
  
      // I need again open my Browser for get Youtube data
      const response = await startAsync({
              authUrl: `https://www.googleapis.com/youtube/v3/channels?access_token=${accessToken}&amp;part=snippet&amp;mine=true&amp;scope=https://www.googleapis.com/auth/youtube.readonly`,
              showInRecents: true
      });
  
      console.log(response.data);
  }
  </code></pre>
  <p>But I get error</p>
  <p><a href="https://i.stack.imgur.com/Zx66p.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Zx66p.png" alt="enter image description here" /></a></p>
  <p><strong>UPDATE 2</strong></p>
  <p>I wanted to see which data is loaded from AuthRequest. And I see pretty weird log. Redirect_uri is different from the set.<a href="https://i.stack.imgur.com/ueuZc.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ueuZc.jpg" alt="enter image description here" /></a></p>
  <p><strong>RESOLUTION</strong></p>
  <p>When I add &quot;https://www.googleapis.com/auth/youtube.readonly&quot; in my scopes - i can get profile data. Another words below is my code.</p>
  <pre><code>import axios from 'axios';
  import * as Google from 'expo-google-app-auth';
  
  // Inside my React component
  
  // Callback function
  
  const signInYoutube = async () =&gt; {
      const config = {
          androidClientId: YOUTUBE_CLIENT_ID,
          scopes: ['https://www.googleapis.com/auth/youtube.readonly']
      };
  
      const { type, accessToken, user } = await Google.logInAsync(config);
  
      if (type === 'success') {
          const response = await axios.get(
                      `https://www.googleapis.com/youtube/v3/channels?part=id&amp;mine=true&amp;key=${encodeURI(YOUTUBE_API_KEY)}`,
                      {
                          headers: {
                              Authorization: `Bearer ${accessToken}`
                          }
                      }
                  );
  
          setYoutubeData({ accessToken, user, youtubeId: response.data.items[0].id });
      }
  };
  
  </code></pre>
  <p><strong>IMPORTANT</strong></p>
  <p>Don't remember add in <a href="https://console.developers.google.com/" rel="nofollow noreferrer">your project</a> <a href="https://console.developers.google.com/apis/library/youtube.googleapis.com?q=YoutubeData" rel="nofollow noreferrer">Youtube API v3</a></p>