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

Issues with OIDExternalUserAgent when requesting OIDAuthState #135

Open
ShayeebWar opened this issue Sep 15, 2021 · 2 comments
Open

Issues with OIDExternalUserAgent when requesting OIDAuthState #135

ShayeebWar opened this issue Sep 15, 2021 · 2 comments

Comments

@ShayeebWar
Copy link

ShayeebWar commented Sep 15, 2021

I switched to GTMAppAuth from AppAuth iOS as it hasn't been updated for a long time. I am struggling to get the OIDAuthState: Earlier i used to get it as follows:

OIDAuthState.authState(byPresenting: request, presenting: self) { authState, error in
if let authState = authState, let accessToken = authState.lastTokenResponse?.accessToken

But now with the GTMAppAuth library it is asking for one more parameter external user agent as follows:

OIDAuthState.authState(byPresenting: request, externalUserAgent: self, callback: { state, error in
})

And it is giving me errors with this parameter. I'm not sure why that parameter is in the call as there is no mention of it in the documentation and what to pass in external user agent? Can you please help me with this?

@ShayeebWar
Copy link
Author

@petea Can you help me with this?

@google google deleted a comment from dpuga1 Sep 23, 2021
@google google deleted a comment from Kullancie Sep 23, 2021
@petea
Copy link
Contributor

petea commented Sep 23, 2021

This sounds like an AppAuth rather than a GTMAppAuth issue. If you're not using GTMAppAuth classes you should depend directly on AppAuth rather than getting it transitively via a GTMAppAuth dependency.

If you're building for iOS, the method you mention using previously should be available via the OIDAuthState+iOS category. However, GTMAppAuth depends on AppAuth/Core which is a subset of AppAuth that does not include the OIDAuthState+iOS category. Returning to a direct dependency on AppAuth should solve your problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants