1.1.19 • Published 2 years ago

aws-federated-login v1.1.19

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

aws-federated-login

Amazon Federated Login Client

Installation

npm i aws-federated-login

Introduction

With this package you can choose between popup and redirection during federated login via AWS

API:

1. awsFederatedLogin

trigger popup function Detailed meaning of fields

interface LoginParams {
    awsAuthorizedUrl: string;
    client_id: string;
    identity_provider: string;
    redirect_uri: string;
    response_type: string;
    scope: string;
    mode?: 'popup' | 'redirect'; // default 'redirect'
    callback: (params: any) => void;
}
export declare const awsFederatedLogin: (loginParams: LoginParams) => void;

2. awsRedirect:

popup middle page send message to the callback function that triggers the popup function

export declare const awsRedirect: () => void;

Demo

// trigger popup page
import { awsFederatedLogin } from 'aws-federated-login'
<button
    onClick={() => {
        awsFederatedLogin({
            awsAuthorizedUrl: 'https://XXX.amazoncognito.com/oauth2/authorize',
            client_id: 'XXX',
            identity_provider: 'Google', // 'Google' 'Facebook'
            redirect_uri: 'http://localhost:3000/pages/callback.html',
            response_type: 'CODE',
            scope: 'email openid phone',
            mode: 'popup',
            callback: (response) => {
                console.log('response is:', response)
            }
        })
    }
>
</button>
// callback.html
import { awsFederatedLogin } from 'aws-federated-login'
awsRedirect()
1.1.19

2 years ago

1.1.18

2 years ago

1.1.17

3 years ago

1.1.16

3 years ago

1.1.15

3 years ago

1.1.14

3 years ago

1.1.13

3 years ago

1.1.12

3 years ago

1.1.11

3 years ago

1.1.10

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago