1.0.76 • Published 5 months ago

@brainstack/auth-aws-cognito v1.0.76

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

@brainstack/auth-aws-cognito Integration IN DEVELOPMENT

This module provides an integration between @brainstack/auth and Amazon Cognito authentication using the aws-amplify library.

Installation

Install the module using npm:

npm install @brainstack/auth-aws-cognito

Usage

To integrate Amazon Cognito authentication into your application using @brainstack/auth, follow these steps:

  1. Import and Configure
import { createAuthCognitoIntegration } from '@brainstack/auth-aws-cognito';
import { createAuthProvider } from '@brainstack/auth';

const awsConfig = {
  // Your AWS Amplify configuration
};

const authIntegration = createAuthCognitoIntegration(awsConfig);
const authProvider = createAuthProvider(authIntegration);
  1. Use the authProvider methods for authentication and authorization in your application:
// Example: Sign in a user
const signInResult = await authProvider.signIn(username, password);
if (signInResult.success) {
  console.log('User signed in successfully');
} else {
  console.error('Sign-in failed');
}

// Example: Check if a user has a specific permission
const hasPermission = await authProvider.hasPermission('write:resource');
if (hasPermission) {
  console.log('User has the required permission');
} else {
  console.log('User does not have the required permission');
}

Contributing

Contributions are welcome! If you would like to contribute to this module, please follow these guidelines:

Fork the repository
Create a new branch for your changes
Make your changes and commit them with descriptive commit messages
Push your changes to your fork
Submit a pull request

License

This module is released under the MIT License.

1.0.76

5 months ago

1.0.75

5 months ago

1.0.74

5 months ago

1.0.72

5 months ago

1.0.70

5 months ago

1.0.62

6 months ago

1.0.61

6 months ago

1.0.60

6 months ago

1.0.59

6 months ago

1.0.58

6 months ago

1.0.57

6 months ago

1.0.56

6 months ago

1.0.55

6 months ago

1.0.54

6 months ago

1.0.53

6 months ago

1.0.52

6 months ago

1.0.51

6 months ago

1.0.50

6 months ago

1.0.49

6 months ago

1.0.48

6 months ago

1.0.47

6 months ago

1.0.46

6 months ago

1.0.45

6 months ago

1.0.44

6 months ago

1.0.43

6 months ago

1.0.42

6 months ago

1.0.41

7 months ago

1.0.40

7 months ago

1.0.39

7 months ago

1.0.38

7 months ago

1.0.36

7 months ago

1.0.35

7 months ago

1.0.34

7 months ago

1.0.33

7 months ago

1.0.31

7 months ago

1.0.27

8 months ago

1.0.26

8 months ago

1.0.25

8 months ago

1.0.24

8 months ago

1.0.23

8 months ago

1.0.22

8 months ago

1.0.21

8 months ago

1.0.20

8 months ago

1.0.19

8 months ago

1.0.18

8 months ago

1.0.17

8 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago