1.1.19 • Published 1 year ago

aws-federated-login v1.1.19

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year 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

1 year ago

1.1.18

1 year ago

1.1.17

1 year ago

1.1.16

1 year ago

1.1.15

1 year ago

1.1.14

1 year ago

1.1.13

1 year ago

1.1.12

1 year ago

1.1.11

1 year ago

1.1.10

1 year ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago