awslabs / amazon-kinesis-video-streams-webrtc-sdk-android

Android SDK for interfacing with Amazon Kinesis Video Streams Signaling Service.
Apache License 2.0
58 stars 37 forks source link

android api or sample code for aws security token service ? #91

Closed ynaver-github closed 1 year ago

ynaver-github commented 1 year ago

1) android sample use congito but I like to use way such as AWS Security Token Service awslabs/amazon-kinesis-video-streams-webrtc-sdk-android

https://aws.amazon.com/ko/articles/authenticating-users-of-aws-mobile-applications-with-a-token-vending-machine/ AWS Security Token Service

is there any sample code for android ?

2) with cognitoIdentity ( pollId, identityId, token ), this there any android api to get Credentials ( AccessKeyId SecretKey: SessionToken ) ?

hassanctech commented 1 year ago

https://github.com/awslabs/amazon-kinesis-video-streams-webrtc-sdk-android/blob/d39fb09be837c3b8a75a5d6ee604409f4bc69ce6/src/main/java/com/amazonaws/kinesisvideo/demoapp/KinesisVideoWebRtcDemoApp.java#L23

Instead of returning AWSMobileClient.getInstance you need to build your own credentials using the AWSCredentialsProvider interface with the accesskey/secretkey/token and try that out. With the session token you need to make sure you use an actual sts session creds provider so that it will handle fetching new credentials when the credential session expires.

hassanctech commented 1 year ago

It seems like this is the credentials provider you are looking for: https://www.javadoc.io/doc/com.amazonaws/aws-android-sdk-core/2.16.1/com/amazonaws/auth/STSSessionCredentialsProvider.html

sirknightj commented 11 months ago

https://github.com/codingspirit/amazon-kinesis-video-streams-webrtc-sdk-android/commit/358ed510d04ff1ba449fa1e505c8b65a3252b192