Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASWebAuthenticationSession and SFAuthenticationSession use the target name instead of bundle display name #343

Closed
ugenlik opened this issue Dec 4, 2018 · 8 comments
Labels
platform-bug Issues caused by the platform, or client software outside the control of AppAuth. question

Comments

@ugenlik
Copy link

ugenlik commented Dec 4, 2018

Describe the bug
When using OIDAuthState.authState(byPresenting: request, presenting: viewController) there is an alertview for devices greater than iOS 11 for single-sign on. Which is obvious.

But the problem is alertview uses scheme name of the app not Display Name from the Info.plist or bundle identifier name from bundle.

Which makes it very confusing for the user, because name of my App is GO, but the project scheme/workspace name is HUGIN

and user sees following when try to login:

screen shot 2018-12-03 at 8 56 31 pm

User doesn't know what HUGIN is , so it is incredibly confusing for everybody.

They need to see either one of this values:

screen shot 2018-12-04 at 4 57 07 pm

Is there a way to pass the Display Name to system so OS doesnt use the scheme name ???

To Reproduce
Steps to reproduce the behavior , just use OIDAuthState.authState(byPresenting in iOS 11 or iOS 12

 // builds authentication request
        let request = OIDAuthorizationRequest(configuration: configuration,
                                clientId: clientID,
                                clientSecret: Config.sharedInstance.identity_ClientSecret,
                                scope: "xxxx",
                                redirectURL: redirectURI,
                                responseType: OIDResponseTypeCode,
                                state: nil, nonce: nil, codeVerifier: nil, codeChallenge: nil, codeChallengeMethod: nil,
                                additionalParameters: additionalParams)

OIDAuthState.authState(byPresenting: request, presenting: viewController) { authState, error in

}
@WilliamDenniss WilliamDenniss added question platform-bug Issues caused by the platform, or client software outside the control of AppAuth. labels Dec 4, 2018
@WilliamDenniss
Copy link
Member

I always thought it was the app name, but now that you raise this I've never directly confirmed that, nor do I know how to change it. Hopefully someone here knows the answer!

So to be clear, it's not using the name that shows under your app's icon on the homescreen?

@ugenlik
Copy link
Author

ugenlik commented Dec 4, 2018

@WilliamDenniss no it does not, it uses either target name or project name, I am not sure which one it is using.

As you can see target name is Hugin, but the display name is mHelpDeskGO QA

screen shot 2018-12-04 at 6 20 01 pm

in the device
screen shot 2018-12-04 at 6 21 31 pm

@julienbodet
Copy link
Collaborator

I also tested on my side and confirm this is the target name that is used (not the project name). It appears to be a bug from Apple's ASWebAuthenticationSession (also the deprecated SFAuthenticationSession on iOS 11) with no way to change this behaviour.

@ugenlik
Copy link
Author

ugenlik commented Dec 8, 2018

It is really annoying, luckily our team has their own identity server and our stake holders are okay with using the identity server without sso.

So I created a gist and by passing the alertview for now.

https://gist.github.com/ugenlik/2a543f351e9b9425800b48266760dc85

@WilliamDenniss
Copy link
Member

Glad you resolved it for your case @ugenlik.

I would expect the standard workaround for this to be renaming the target to the desired name.

@WilliamDenniss WilliamDenniss changed the title Alertview / Pop-up to login in iOS 11 - iOS 12 uses scheme/project name instead of Display Name ASWebAuthenticationSession and SFAuthenticationSession use the target name instead of bundle display name Dec 8, 2018
@WilliamDenniss
Copy link
Member

Closing this as there's not much we can do on the AppAuth side, and we have a known workaround, but feel free to continue commenting for how you all workaround this, and if any changes to the OS behavior are observed!

@gregersn
Copy link

Struggling with the same problem, I found that what is set in CFBundleName in Info.plist is what is displayed in that dialog. That is the short version of CFBundleDisplayName.

@liuyang2211
Copy link

4271709519256_ pic

Change info.plist Bundle name is invalid. We need change in buildSetting -> Product Name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform-bug Issues caused by the platform, or client software outside the control of AppAuth. question
Projects
None yet
Development

No branches or pull requests

5 participants