1.0.76 • Published 2 years ago

@brainstack/auth-aws-cognito v1.0.76

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

2 years ago

1.0.75

2 years ago

1.0.74

2 years ago

1.0.72

2 years ago

1.0.70

2 years ago

1.0.62

2 years ago

1.0.61

2 years ago

1.0.60

2 years ago

1.0.59

2 years ago

1.0.58

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.49

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.40

2 years ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.36

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.33

2 years ago

1.0.31

2 years ago

1.0.27

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago