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

CCT - AuthTab Sample Demo #486

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

erikrodriguez-se
Copy link

This PR contains a working demo for an implementation of AuthTab for Chrome Custom Tabs for Android. The included project, custom-tabs-authview, uses the existing custom-tabs-oauth demo as a guide for authentication using a website, in this case Github.

Some notes:

  • The demo uses the custom redirect scheme. If it is desired to use https scheme instead, I can update the project accordingly.
  • Some updates beyond the demo were required for the android-browser-helper project to compile in newer versions of Android Studio. Namely, these changes included namespace additions to gradle files as well as updating the gradle version used in the project.

Copy link

google-cla bot commented Dec 3, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@orbital17
Copy link
Collaborator

Hi Erik, thanks for the PR!
In general, SDK version, Java version and Gradle version need to be updated, but they need to be kept consistent across the project, and it's better to handle these updates in a separate PR.
Would you like to create a PR for the updates? We are not sure when we’ll be able to handle this ourselves. Alternatively, you can try to implement the demo without updating the versions.

@ukaratkevich
Copy link
Collaborator

+1 to make a separate PR with build changes.
I also doubt that we want to use androidx snapshots for demo, I'd wait at least for 1.9.0 alpha.

@erikrodriguez-se
Copy link
Author

Hi all, I can split this in to two PRs. I'll make this one specific to AuthTab and will create another for project updates.

.build();

// Open the Authorization URI in a Chrome Custom Auth Tab.
AuthTabIntent authTabIntent = new AuthTabIntent.Builder().build();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that AuthView demo is almost identical to the Oauth demo, the difference are:

  1. New callback intent-filter
  2. Launcher intents are different
  3. Different result handling

I think that we can merge this demo into Oauth, as far as I can see it'd require:

  1. Add an AuthView callback intent-filter into the AndroidManifest
  2. Demo should provide a way to switch between CCT and AuthView. I think a checkbox and shouldUseAuthView should be enough.
  3. In AuthManager launch intents and handle results based on shouldUseAuthView.
  4. I'd also add comments why AuthView is preferable in AuthManager or even deprecate CCT flow at all.

This way we get rid of duplication and provide some kind of migration steps from CCT to AuthView.
What do you think?

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

Successfully merging this pull request may close these issues.

3 participants