SFAuthenticationSession appearance

1.3k Views Asked by At

How can I change tintColor and barTintColor on the SafariVC that is presented when using SFAuthenticationSession ?

I tried to change UINavigationBar and UIToolBar and UIBarButtonItem appearance but it doesn't respect them.

Thanks

1

There are 1 best solutions below

0
On

Changing tintColor and barTintColor of the Safari view controller used in SFAuthenticationSession isn't supported in the API.

I think the logic is that your OAuth authentication should be a separate process from your app's and that should be obvious to the user (from the docs):

If an application uses SFAuthenticationSession, users are prompted by a dialog to give explicit consent, allowing the application to access the website's data in Safari. When the webpage is presented, it runs in a separate process, so the user and web service are guaranteed that the app has no way to gain access to the user’s credentials. Instead, the app gets a unique authentication token.

P.S. SFAuthenticationSession has been deprecated in iOS 12 in favor of ASWebAuthenticationSession. The API's are very similar though, so not much help for customization.