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

Provider equivalent for signInWithWebUI #2967

Closed
1 task done
dawidhyzy opened this issue Dec 18, 2024 · 3 comments
Closed
1 task done

Provider equivalent for signInWithWebUI #2967

dawidhyzy opened this issue Dec 18, 2024 · 3 comments
Labels
auth Related to the Auth category/plugins pending-maintainer-response Issue is pending response from an Amplify team member question General question

Comments

@dawidhyzy
Copy link

dawidhyzy commented Dec 18, 2024

Before opening, please confirm:

Language and Async Model

Kotlin - Coroutines

Amplify Categories

Authentication

Gradle script dependencies

// Put output below this line
amplify = "2.25.1"

amplifyframework-core = { module = "com.amplifyframework:core-kotlin", version.ref = "amplify" }
amplifyframework-aws-auth-cognito = { module = "com.amplifyframework:aws-auth-cognito", version.ref = "amplify" }

Environment information

# Put output below this line
------------------------------------------------------------
Gradle 8.11.1
------------------------------------------------------------

Build time:    2024-11-20 16:56:46 UTC
Revision:      481cb05a490e0ef9f8620f7873b83bd8a72e7c39

Kotlin:        2.0.20
Groovy:        3.0.22
Ant:           Apache Ant(TM) version 1.10.14 compiled on August 16 2023
Launcher JVM:  17.0.12 (JetBrains s.r.o. 17.0.12+1-b1207.37)
Daemon JVM:    /Users/dawidhyzy/Library/Java/JavaVirtualMachines/jbr-17.0.12-1/Contents/Home (no JDK specified, using current Java home)
OS:            Mac OS X 15.1.1 aarch64

Please include any relevant guides or documentation you're referencing

https://github.com/aws-amplify/amplify-android/tree/main/aws-auth-cognito

Describe the feature request

How can I specify a custom provider when using Amplify.Auth.signInWithWebUI?
This is what our web client does:

    await signInWithRedirect({
      provider: { custom: "XYZ" },
    });

Initialization steps (if applicable)

No response

Code Snippet

// Put your code below this line.

amplifyconfiguration.json

No response

GraphQL Schema

// Put your schema below this line

Additional information and screenshots

No response

@github-actions github-actions bot added pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Dec 18, 2024
@sebaland sebaland added auth Related to the Auth category/plugins question General question and removed pending-triage Issue is pending triage pending-maintainer-response Issue is pending response from an Amplify team member labels Dec 18, 2024
@sebaland
Copy link
Member

Hi @dawidhyzy! This should be the equivalent for Android using Kotlin coroutines:

try {
    val result = Amplify.Auth.signInWithSocialWebUI(AuthProvider.custom("XYZ"), this)
    Log.i("Sign in OK: $result")
} catch (error: AuthException) {
    Log.e("Sign in failed", error)
}

You can find the callbacks/Java/RxJava examples in here.

@tylerjroach tylerjroach added the closing soon This issue will be closed in 7 days unless further comments are made. label Dec 18, 2024
@dawidhyzy
Copy link
Author

@ruisebas thank you! That was exactly what I was looking for.

@github-actions github-actions bot added pending-maintainer-response Issue is pending response from an Amplify team member and removed closing soon This issue will be closed in 7 days unless further comments are made. labels Dec 19, 2024
Copy link
Contributor

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Related to the Auth category/plugins pending-maintainer-response Issue is pending response from an Amplify team member question General question
Projects
None yet
Development

No branches or pull requests

3 participants