2.0.4 • Published 5 years ago

okta-cognito-rest-client v2.0.4

Weekly downloads
40
License
-
Repository
-
Last release
5 years ago

Okta Cognito Axios Client

Read more about what it does here.

Basic Usage

Install: npm install --save okta-cognito-rest-client

Use:

import { oktaCognitoRestClientGenerator } from 'okta-cognito-rest-client'

const client = oktaCognitoRestClientGenerator({
	awsConfig: {
		cognitoClientId: '123',
		cognitoBaseUrl: 'https://my-cognito.auth.us-east-1.amazoncognito.com',
		redirectUrl: `https://my-base-app-url.com`
	}
})

This gives you a pre-configured Axios Client. Use it like you would any other Axios Client.

Also, at some point during a login flow, you'll get a code in your url that needs to be used to fetch and set real JWTs. There is already a method on the client to handle this async function:

const code = getQueryParamValue('code') // '123-456-etc'
client.setTokens(code).then(() => console.log('tokens set!'))

I'm sure this can be improved but for now this is the way to do it.

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

1.1.2-alpha.6

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.1

5 years ago

0.0.2-alpha.8

5 years ago

0.0.2-alpha.4

5 years ago

0.0.2-alpha.2

5 years ago