/Flurl.Unofficial.AWSCognitoIdentity

A small helper to authenticate Flurl requests for AWS Cognito Identity

Primary LanguageC#MIT LicenseMIT

Flurl.Unofficial.AWSCognitoIdentity

NuGet

A small helper to authenticate Flurl requests for AWS Cognito Identity

How to login:

  1. Create a subclass of CognitoAuthClient.
  2. Implement the following abstract properties depending on your setup:
    • ServiceURL
    • PoolID
    • IdentityPoolID
    • ClientID
    • RegionEndpoint
  3. Create an instance of your client and call LoginAsync(string username, string password) when you are ready to login.

How to authenticate a request

  1. Import Extensions and call WithCognitoAuth(CognitoAuthClient), passing in your logged in client as the single parameter. (returns the request for chaining)
  2. Dispatch as you normally would, authentication is handled lazily in the background on an event.

Example:

"https://example.com/real_cognito_endpoint/hey".WithCognitoAuth().GetJsonAsync();

Notes:

Dependencies: