In the iOS AWSCore library one can authorize bespoke third party auth systems into an AWS identity pool roughly as follows:
let myIdProvider = MyCustomIdProvider()
let credentialsProvider = AWSCognitoCredentialsProvider(regionType: AWSRegionType.USWest2, identityProvider: myIdProvider)
let configuration = AWSServiceConfiguration(region: AWSRegionType.USWest2, credentialsProvider:credentialsProvider)!
// which is then used for things like S3 access...
// The custom provider class...
class MyCustomIdProvider : AWSCognitoCredentialsProviderHelper {
override func token() -> AWSTask<NSString> {
// Do the verification here
}
}
I want to move this code to a cross platform solution (in Dart/Flutter ideally but happy with a JS solution for now). How can I accomplish that in Amplify?
You can use following steps in short you really not required above code when work with AWS Cognito amplify API this API provide abstraction and make your life simple.
Following is example in react js but you can use same into your code as its using simple Java scripts,you can download add your user pool details in config.json and check in local
Code example:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.