title: Why do I get a redirect URI mismatch when trying to log into Box?
body: <p>When using the <a href="https://github.com/box/box-ios-sdk-v2" rel="nofollow noreferrer">Box SDK for iOS</a> to do OAuth, I am shown a webpage with this error:</p>
  
  <p><img src="https://i.stack.imgur.com/fWsNr.png" alt="enter image description here"></p>
  
  <blockquote>
    <p>Error: redirect_uri_mismatch</p>
    
    <p>response_type=code
    redirect_uri=boxsdk-our4iypzazstfpx8j70e8tlc3eyn9c4l://boxsdkoauth2redirect
    state=ok client_id=our4iypzazstfpx8j70e8tlc3eyn9c4l</p>
  </blockquote>
  
  <p>I used the code that they suggested:</p>
  
  <pre><code>[self
      presentViewController:[[BoxAuthorizationViewController alloc]
          initWithAuthorizationURL:[[BoxSDK sharedSDK].OAuth2Session authorizeURL]
          redirectURI:nil
      ]
      animated:YES
      completion:nil
  ];
  </code></pre>
  
  <p>My client ID and client secret are set prior to this. In my info.plist file, I have <em>boxsdk-our4iypzazstfpx8j70e8tlc3eyn9c4l</em> as a URL scheme. The only instruction I could not follow is: </p>
  
  <blockquote>
    <p>Note: When setting up your service on Box, leave the OAuth2 reditrect
    URI blank. The SDK will provide a custom redirect URI when issuing
    OAuth2 calls; doing so requires that no redirect URI be set in your
    service settings.</p>
  </blockquote>
  
  <p>When I attempt to leave the redirect URI blank and save the form in the developer console, I get the this error:</p>
  
  <blockquote>
    <p>OAuth2 redirect URL must specify a valid URL and must not be http://</p>
  </blockquote>
  
  <p>So I am forced to input something. I have inputted "<a href="https://mydomain.com" rel="nofollow noreferrer">https://mydomain.com</a>" (with my real domain). I modified the iOS code to pass that URI into the BoxAuthorizationViewController, but I still get the same error webpage.</p>