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

Different delegate methods for each Credentials plugin #42

Open
crspybits opened this issue Jan 8, 2017 · 5 comments
Open

Different delegate methods for each Credentials plugin #42

crspybits opened this issue Jan 8, 2017 · 5 comments

Comments

@crspybits
Copy link
Contributor

For the Google credentials, the CredentialsGoogleOptions.userProfileDelegate is currently defined as

public static let userProfileDelegate = "userProfileDelegate"

However, since the options seems scoped across all plugins (i.e., in the options property of a Credentials object), could CredentialsGoogleOptions.userProfileDelegate be defined as:

public static let userProfileDelegate = "googleUserProfileDelegate" ?

@irar2
Copy link
Contributor

irar2 commented Jan 8, 2017

These are not the same options. There are two kinds of options:

  • Options passed to a plugin constructor. The keys are CredentialsGoogleOptions in the case of CredentialsGoogle plugin.
  • Options passed from Credentials to plugins' authenticate() methods during authentication process. These options are passed to Credentials.init(). CredentialsGoogle plugin ignores them at the moment.

@crspybits
Copy link
Contributor Author

Thanks for your response. I'm not using the CredentialsGoogle plugin, I'm using the CredentialsGoogleToken plugin. I do not see an options parameter for that constructor. It seems that CredentialsGoogleToken takes its options only from the Credentials object.

@irar2
Copy link
Contributor

irar2 commented Jan 9, 2017

You are right, but I think a better way to fix this is to add options to CredentialsGoogleToken constructor similar to CredentialsGoogle.

@crspybits
Copy link
Contributor Author

👍

irar2 added a commit to Kitura/Kitura-CredentialsGoogle that referenced this issue Jan 12, 2017
irar2 added a commit to Kitura/Kitura-CredentialsFacebook that referenced this issue Jan 12, 2017
irar2 added a commit to Kitura/Kitura-CredentialsGoogle that referenced this issue Jan 12, 2017
irar2 added a commit to Kitura/Kitura-CredentialsFacebook that referenced this issue Jan 12, 2017
shmuelk pushed a commit to Kitura/Kitura-CredentialsGoogle that referenced this issue Jan 12, 2017
* Kitura/Kitura-Credentials#42 Pass options to the constructor

* Kitura/Kitura-Credentials#42 Update documentation

* IBM-Swift/Kitura-Crdedentials#42 Keep the current API - look for options in authenticate() argument if not set in init()
shmuelk pushed a commit to Kitura/Kitura-CredentialsFacebook that referenced this issue Jan 12, 2017
* Kitura/Kitura-Credentials#42 Pass options to the constructor

* Kitura/Kitura-Credentials#42 Update documentation

* IBM-Swift/Kitura-Crdedentials#42 Keep the current API - look for options in authenticate() argument if not set in init()
@irar2
Copy link
Contributor

irar2 commented Jan 15, 2017

@crspybits Could you please verify that the problem is solved now?

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