canceraiddev / elm-aws-amplify / AWS.Amplify.Auth

Configure authentication using Amazon Cognito.

Identity


type alias Identity =
{ identityId : String
, credentials : Credentials 
}

IdentityId


type alias Credentials =
{ accessKeyId : String
, secretAccessKey : String
, expiration : Time.Posix
, sessionToken : Maybe String 
}

Credentials

Configure


type alias Config =
{ region : AWS.Config.Region
, identityPoolId : String 
}

Auth config

configure : Config -> Task (AWS.Http.Error AWS.Http.AWSAppError) Identity

Configure authentication.

Fetches identity id from identity pool and then fetches credentials for identity id.

AWS.Amplify.Auth.configure
    { region = "ap-southeast-2"
    , identityPoolId = "ap-southeast-2:123e4567-e89b-12d3-a456-426614174000"
    }

getCredentials : AWS.Config.Region -> String -> Task (AWS.Http.Error AWS.Http.AWSAppError) Identity

Get credentials for identityId