Post

Replies

Boosts

Views

Activity

Reply to OAuth using ASWebAuthenticationSession, redirect URI
I did look at that one, thanks. Can you give me a bit more with regard to flow? Here is the code I have been using that now doesn't work because of the complete URL requirement. print("(CEcoobeeAPIConnect) Requesting Flair API authorization token") // callbackUrlScheme = "com.SmartVentsTwo://auth" callbackUrlScheme = "https://com.SmartVentsTwo://auth" callbackUrlScheme = callbackUrlScheme.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)! let authURL = URL(string: "https://api.ecobee.com/authorize?response_type=code&client_id= SMART_APP_CLIENT_ID&redirect_uri=(callbackUrlScheme)&scope=smartWrite&state=SmartVentRequest") print("(CEcobeeAPIConnect) App Authorization request URL is (authURL!.absoluteString)") self.m_webAuthSession = ASWebAuthenticationSession.init(url: authURL!, callbackURLScheme: callbackUrlScheme, completionHandler: { (callBack:URL?, error:Error?) in print("(CEcoobeeAPIConnect) Ecobee API authorization token request returned, callbackURL is (String(describing: callBack))") // handle auth response …… }})
Topic: App & System Services SubTopic: Core OS Tags:
Apr ’24
Reply to OAuth using ASWebAuthenticationSession, redirect URI
Hello, Thank you, but can you be a bit more specific please? The documentation is quite wanting and I'm not sure the parameter. You swapped my "authURL!" for "requestContext.url"... what is requestContext? I'm assuming the host: "...." is host: "https://com.SmartVentsTwo://auth"... is that correct? What igoes in "path:"? Thank you!
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24
Reply to OAuth using ASWebAuthenticationSession, redirect URI
I did look at that one, thanks. Can you give me a bit more with regard to flow? Here is the code I have been using that now doesn't work because of the complete URL requirement. print("(CEcoobeeAPIConnect) Requesting Flair API authorization token") // callbackUrlScheme = "com.SmartVentsTwo://auth" callbackUrlScheme = "https://com.SmartVentsTwo://auth" callbackUrlScheme = callbackUrlScheme.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)! let authURL = URL(string: "https://api.ecobee.com/authorize?response_type=code&client_id= SMART_APP_CLIENT_ID&redirect_uri=(callbackUrlScheme)&scope=smartWrite&state=SmartVentRequest") print("(CEcobeeAPIConnect) App Authorization request URL is (authURL!.absoluteString)") self.m_webAuthSession = ASWebAuthenticationSession.init(url: authURL!, callbackURLScheme: callbackUrlScheme, completionHandler: { (callBack:URL?, error:Error?) in print("(CEcoobeeAPIConnect) Ecobee API authorization token request returned, callbackURL is (String(describing: callBack))") // handle auth response …… }})
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Apr ’24