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

Sign in with web ui support #54

Open
e-pavan opened this issue Jan 9, 2025 · 5 comments
Open

Sign in with web ui support #54

e-pavan opened this issue Jan 9, 2025 · 5 comments

Comments

@e-pavan
Copy link

e-pavan commented Jan 9, 2025

Is sign in with web ui (federated sign in) supported? In the amplify library the method is

public func signInWithWebUI(
        presentationAnchor: AuthUIPresentationAnchor? = nil,
        options: AuthWebUISignInRequest.Options? = nil) async throws -> AuthSignInResult
@adam-fowler
Copy link
Member

Are we talking about signing into Cognito user pools using a third party service?
All the operations to do sign in with web should be available but there is nothing as high level as what amplify provides

@e-pavan
Copy link
Author

e-pavan commented Jan 23, 2025

Are we talking about signing into Cognito user pools using a third party service? All the operations to do sign in with web should be available but there is nothing as high level as what amplify provides

Yes, sign in with google, apple, azure... In the amplify library the method is signInWithWebUI.

All the operations to do sign in with web should be available but there is nothing as high level as what amplify provides

What does it mean? Is it only available in soto-core?

@adam-fowler
Copy link
Member

What does it mean? Is it only available in soto-core?

You can use the cognitoIdentity credential provider that is available in Soto to get AWS credentials eg

let credentialProvider: CredentialProviderFactory = .cognitoIdentity(
    identityPoolId: "my-identiy-pool-id",
    identityProvider: .externalIdentityProvider(tokenProvider: { context in
        // get identity from service (google, apple etc)
        // you'll have to work this bit out for yourself, I don't know the 
        // details of getting identities from external services
    }),
    region: .euwest1
)
let awsClient = AWSClient(credentialProvider: credentialProvider)

@e-pavan
Copy link
Author

e-pavan commented Jan 24, 2025

What does it mean? Is it only available in soto-core?

You can use the cognitoIdentity credential provider that is available in Soto to get AWS credentials eg

let credentialProvider: CredentialProviderFactory = .cognitoIdentity(
identityPoolId: "my-identiy-pool-id",
identityProvider: .externalIdentityProvider(tokenProvider: { context in
// get identity from service (google, apple etc)
// you'll have to work this bit out for yourself, I don't know the
// details of getting identities from external services
}),
region: .euwest1
)
let awsClient = AWSClient(credentialProvider: credentialProvider)

Ok, but how do I sign-in with the methods available on soto-core? I don't think it's supported.

@e-pavan
Copy link
Author

e-pavan commented Jan 24, 2025

In the public function:
public func initiateAuth(_ input: InitiateAuthRequest, logger: Logger = AWSClient.loggingDisabled) async throws -> InitiateAuthResponse

I read:

Initiates sign-in for a user in the Amazon Cognito user directory. You can't sign in a user with a federated IdP with InitiateAuth. For more information, see Adding user pool sign-in through a third party.

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