canceraiddev/elm-aws-amplify/3.0.0

NOTE: the latest version is 4.0.0

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 : Posix
, sessionToken : Maybe String
}

Credentials

Configure

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

Auth config

configure : Config -> Task (Error 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 : Region -> String -> Task (Error AWSAppError) Identity

Get credentials for identityId