Skip to content

GraphQL and REST clients that work easily with Okta / Cognito setups

Notifications You must be signed in to change notification settings

jsphweid/okta-cognito-clients

Repository files navigation

Okta Cognito Clients

Popular javascript clients extended with functionality to deal with Okta and Cognito auth more easily.

Basic Usage

Okta Cognito GraphQL Client

Okta Cognito REST Client

What this library does...

The respective packages above both provide a function that generates clients.

With some basic config passed in, these clients can:

  • attach idTokens to all requests
  • fetch new idTokens when only a refreshToken is valid
  • store and retrieve tokens in localStorage (but can be overridden)
  • handle entire auth flow automatically (but it provides a convenience function for that)
  • handle when idToken and refreshToken are both invalid

TODO

  • write tests?
  • maybe consider making this lib more of one that decorates axios or apollo instead of makes new opinionated clients for you...?
  • if an token is not valid and refresh token can't retrieve a new idtoken, handle?
  • does this really have anything to do with Okta anymore?

About

GraphQL and REST clients that work easily with Okta / Cognito setups

Resources

Stars

Watchers

Forks

Packages

No packages published