danilop / LambdAuth

A sample authentication service implemented with a server-less architecture, using AWS Lambda to host and execute the code and Amazon DynamoDB as persistent storage. This provides a cost-efficient solution that is scalable and highly available and can be used with Amazon Cognito for Developer Authenticated Identities.
MIT License
1.37k stars 234 forks source link

Swift Implementation - Transitioning a user into the authenticated role #54

Open rbarbish opened 8 years ago

rbarbish commented 8 years ago

This might be a questionable place to ask this question but since it is specific to this framework, I thought I'd ask here. I'm having trouble knowing what to do after receiving the login token to transition my user into the authenticated role. I'm using the AWS Mobile SDK for iOS and writing my client app in Swift. The full details of my problem are listed here - http://stackoverflow.com/questions/38976295/aws-lambda-cognito-authentication-assuming-auth-role

Any guidance would be appreciated - thank you.

hassankhan commented 8 years ago

Have you checked out this sample project? Usually you'd add the token to the credentials - in Unity/C# it's credentials.addLogin(providerName, token), not sure how it is in Swift, sorry.

rbarbish commented 8 years ago

Yea, it's quite out of date and a lot of that example doesn't work with the current version of the AWS Mobile SDK

hassankhan commented 8 years ago

Useful?

let token = FBSDKAccessToken.currentAccessToken().tokenString
credentialsProvider.logins = [AWSCognitoLoginProviderKey.Facebook.rawValue: token]
leonardofed commented 8 years ago

Thanks Hassan. That was helpful.

2016-08-18 21:01 GMT+02:00 Hassan Khan notifications@github.com:

Useful?

let token = FBSDKAccessToken.currentAccessToken().tokenString credentialsProvider.logins = [AWSCognitoLoginProviderKey.Facebook.rawValue: token]

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danilop/LambdAuth/issues/54#issuecomment-240822956, or mute the thread https://github.com/notifications/unsubscribe-auth/AG9f03FSQJERkifjenPVppSPiOOvbLMeks5qhKvsgaJpZM4JlZia .

hassankhan commented 8 years ago

No problem, hopefully it helped @rbarbish too 😄

mannyveloso commented 7 years ago

For this, see issue 357 in the AWS SDK git

https://github.com/aws/aws-sdk-ios/issues/357