Auth0 Home Blog Docs

Auth0.plist for iOS with different keys per stage



Can I set the keys with code rather then the auto load form auth0.plist?

I need to set them differently depending on build scheme, ie. dev and prod.

Or can I add them to the Info.plist instead somehow, since I do have individual Info.plist per stage.


What was your solution?


Could not find one. I now manually change it when I have to build for production, which is not great.


I was going to do the same thing as described here


yeah I guess that would work… so you keep the file in different sub folders then copy it in… Seems like a lot of hassle though for something that would be very simple it auth0 just used the normal Info.plist rather than their own…


The way I resolved this problem is by including a Run Script in the Build Phases underneath the Copy Bundle Resources phase. It looks like this:

![Run Script][1]

The script itself is fairly simple:




if  "$CONFIGURATION" == "Debug" ]; then

The only thing that needs to be changed for the above script is RESOURCE_PATH=$SRCROOT/PathToAuth0Plists. You should make this the path to the Auth0Debug.plist and Auth0Release.plist.

Then you need to add a Auth0Debug.plist and an Auth0Release.plist each defining the appropriate clientID and domain.

This isn’t ideal, but it works. Hopefully Auth0 will support this need in the future.