Using OAuth2.0 Swift authentication

Hello All,

I am developing an iOS application for crm. I am try to authentication using Oauth2.0. There are in bellow code.

let oauthswift = OAuth2Swift(

            consumerKey: client_id,

            consumerSecret: clientSecret,

            authorizeUrl: authURL,

            accessTokenUrl: accessURL,

            responseType : responseType )

        

        self.oauthswift = oauthswift

        oauthswift.accessTokenBasicAuthentification = true

        oauthswift.authorize(withCallbackURL: callBackURL, scope: scope, state:state, success: { (credentials, response, parameters) in

            // print(response as Any)  

        }, failure: { (error) in

            print(error)

        })

Question :

  1. There are right way to authentication in iOS ?
  2. How can i authenticate using this code ?
  3. After login or  authentication i want to back my application, In suger CRM from where i can set redirect URL ?