title: How to login directly in Auth0 without redirect universal login page?
body: <p>I'm working on Auth0 integration, i successfully integrated Auth0 SDK in my Swift project, but i want to implement direct login from my app with out redirect into Auth0 universal login page. </p>
  
  <p>I studied mobile login flow here (<a href="https://auth0.com/docs/flows/concepts/mobile-login-flow" rel="nofollow noreferrer">https://auth0.com/docs/flows/concepts/mobile-login-flow</a>
  ). </p>
  
  <p>I implemented Auth0 login in iOS Swift it's working. But i want direct login.</p>
  
  <p>See my screens </p>
  
  <p>When we click login in my app it shows pop up. 
  <a href="https://i.stack.imgur.com/AebUS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AebUS.png" alt="enter image description here"></a></p>
  
  <p>Click continue it will open Auth0.com page (I don't want this page, i want direct login with out this page How?)</p>
  
  <p><a href="https://i.stack.imgur.com/qafiG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qafiG.png" alt="enter image description here"></a></p>
  
  <p>I don't want this page, i want direct login with out this page through mu app login page, How?. </p>
  
  <p><strong>Is it possible?.</strong></p>
  
  <p>For this i followed this link <a href="https://auth0.com/docs/flows/guides/mobile-login-flow/add-login-using-mobile-login-flow" rel="nofollow noreferrer">https://auth0.com/docs/flows/guides/mobile-login-flow/add-login-using-mobile-login-flow</a> and implemented <strong>code_verifier and code_challage.</strong> But when i implement <strong>Authorize the User</strong> it's given <strong>html response</strong>. </p>
  
  <p>My code is:</p>
  
  <pre><code>func codeVerifier() {
      var buffer = [UInt8](repeating: 0, count: 32)
      _ = SecRandomCopyBytes(kSecRandomDefault, buffer.count, &amp;buffer)
      let verifier = Data(bytes: buffer).base64EncodedString()
          .replacingOccurrences(of: "+", with: "-")
          .replacingOccurrences(of: "/", with: "$_")
          .replacingOccurrences(of: "=", with: "")
          .trimmingCharacters(in: .whitespaces)
  
      print("Code_Verifier : \(verifier)")
  
      codeChallenger(verifier: verifier)
  }
  
  func codeChallenger(verifier:String) {
      // Dependency: Apple Common Crypto library
      // http://opensource.apple.com//source/CommonCrypto
      guard let data = verifier.data(using: .utf8) else {
  
          return
      }
  
      var buffer = [UInt8](repeating: 0,  count: Int(CC_SHA256_DIGEST_LENGTH))
      data.withUnsafeBytes {
          _ = CC_SHA256($0, CC_LONG(data.count), &amp;buffer)
      }
      let hash = Data(bytes: buffer)
      let challenge = hash.base64EncodedString()
          .replacingOccurrences(of: "+", with: "-")
          .replacingOccurrences(of: "/", with: "$_")
          .replacingOccurrences(of: "=", with: "")
          .trimmingCharacters(in: .whitespaces)
  
      print("Code_Challenger : \(challenge)")
  
      authorizwTheUser(code_challange: challenge)
  }
  
  func authorizwTheUser(code_challange:String) {
  
      let url = "https://domain.auth0.com/authorize?"
  
      var request = URLRequest(url: URL(string: url)!)
  
              request.setValue("application/json", forHTTPHeaderField: "Content-Type")
              request.httpMethod = "GET"
  
              print("URL : \(request)")
  
      let parameters = "response_type=token&amp;code_challenge=\(code_challange)&amp;code_challenge_method=S256&amp;client_id=&amp;redirect_uri=com.myappname.Auth0DemoSwift://domainname.auth0.com/ios/com.domainname.Auth0DemoSwift/callback&amp;scope=openid profile&amp;state=xyzABC123x"
  
      request.httpBody = parameters.data(using: .utf8)
  
      print(parameters)
  
              let task = URLSession.shared.dataTask(with: request) { data, response, error in guard let data = data, error == nil else { // check for fundamental networking error
                  print("error=\(String(describing: error))")
                  return
                  }
  
                  if let httpStatus = response as? HTTPURLResponse, httpStatus.statusCode != 200 { // check for http errors
                      print("statusCode should be 200, but is \(httpStatus.statusCode)")
                      print("response = \(String(describing: response))")
                  }
  
                                              // If Response is in String formate
                                              let responseString = String(data: data, encoding: .utf8)
                                              let dictionary = data
                                              print("dictionary = \(dictionary)")
                                              print("responseString = \(String(describing: responseString!))")
  
                  do {
                      let response = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as? [String: AnyObject]
                      print(response!)
  
                      let res = response!["Response"]
                      let status = res!["status"] as! String
  
                      if status == "SUCCESS" {
  
                      } else {
  
                      }
  
                  } catch let error as NSError {
                      print(error)
                  }
              }
  
              task.resume()
  
  }
  </code></pre>