@@ -21,7 +21,7 @@ NODE_ENV=development
2121COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
2222COGNITO_CLIENT_ID=your_dev_client_id
2323COGNITO_CLIENT_SECRET=your_dev_client_secret
24- COGNITO_SCOPE=backend -api-v3-admins/auths:read
24+ COGNITO_SCOPE=cognito -api-scope
2525API_BASE_URL=http://localhost:3000/v1
2626```
2727
@@ -33,7 +33,7 @@ NODE_ENV=staging
3333COGNITO_DOMAIN=your-staging-cognito-domain.auth.region.amazoncognito.com
3434COGNITO_CLIENT_ID=your_staging_client_id
3535COGNITO_CLIENT_SECRET=your_staging_client_secret
36- COGNITO_SCOPE=backend -api-v3-admins/auths:read
36+ COGNITO_SCOPE=cognito -api-scope
3737API_BASE_URL=https://staging-api.example.com/v1
3838```
3939
@@ -45,7 +45,7 @@ NODE_ENV=production
4545COGNITO_DOMAIN=your-prod-cognito-domain.auth.region.amazoncognito.com
4646COGNITO_CLIENT_ID=your_prod_client_id
4747COGNITO_CLIENT_SECRET=your_prod_client_secret
48- COGNITO_SCOPE=backend -api-v3-admins/auths:read
48+ COGNITO_SCOPE=cognito -api-scope
4949API_BASE_URL=https://api.example.com/v1
5050```
5151
@@ -64,7 +64,7 @@ nano .env.local
6464
6565The easiest way to understand the Cognito API is through the complete API documentation:
6666
67- ** Direct Link** : [ API Reference - OAuth2 Token Endpoint] ( https://casparhealth.github.io /auth-integration/api/)
67+ ** Direct Link** : [ API Reference - OAuth2 Token Endpoint] ( /auth-integration/api/ )
6868
6969This page provides:
7070- ** Complete Specification** : Full OpenAPI documentation
@@ -76,7 +76,10 @@ This page provides:
7676
7777#### Development
7878``` bash
79- # Start development server
79+ # Option 1: Use the convenience script (recommended)
80+ ./start-dev.sh
81+
82+ # Option 2: Use npm directly
8083npm run dev
8184
8285# Test with development credentials
@@ -85,7 +88,7 @@ curl -X POST "https://YOUR_DEV_COGNITO_DOMAIN/oauth2/token" \
8588 -d " grant_type=client_credentials" \
8689 -d " client_id=YOUR_DEV_CLIENT_ID" \
8790 -d " client_secret=YOUR_DEV_CLIENT_SECRET" \
88- -d " scope=backend -api-v3-admins/auths:read "
91+ -d " scope=cognito -api-scope "
8992```
9093
9194#### Staging
@@ -99,7 +102,7 @@ curl -X POST "https://YOUR_STAGING_COGNITO_DOMAIN/oauth2/token" \
99102 -d " grant_type=client_credentials" \
100103 -d " client_id=YOUR_STAGING_CLIENT_ID" \
101104 -d " client_secret=YOUR_STAGING_CLIENT_SECRET" \
102- -d " scope=backend -api-v3-admins/auths:read "
105+ -d " scope=cognito -api-scope "
103106```
104107
105108#### Production
@@ -113,7 +116,7 @@ curl -X POST "https://YOUR_PROD_COGNITO_DOMAIN/oauth2/token" \
113116 -d " grant_type=client_credentials" \
114117 -d " client_id=YOUR_PROD_CLIENT_ID" \
115118 -d " client_secret=YOUR_PROD_CLIENT_SECRET" \
116- -d " scope=backend -api-v3-admins/auths:read "
119+ -d " scope=cognito -api-scope "
117120```
118121
119122### 1. Using cURL (Generic)
@@ -124,7 +127,7 @@ curl -X POST "https://YOUR_COGNITO_DOMAIN/oauth2/token" \
124127 -d " grant_type=client_credentials" \
125128 -d " client_id=YOUR_CLIENT_ID" \
126129 -d " client_secret=YOUR_CLIENT_SECRET" \
127- -d " scope=backend -api-v3-admins/auths:read "
130+ -d " scope=cognito -api-scope "
128131```
129132
130133### 2. Using JavaScript (Browser)
@@ -135,7 +138,7 @@ async function getCognitoToken() {
135138 formData .append (' grant_type' , ' client_credentials' );
136139 formData .append (' client_id' , ' YOUR_CLIENT_ID' );
137140 formData .append (' client_secret' , ' YOUR_CLIENT_SECRET' );
138- formData .append (' scope' , ' backend -api-v3-admins/auths:read ' );
141+ formData .append (' scope' , ' cognito -api-scope ' );
139142
140143 try {
141144 const response = await fetch (' https://YOUR_COGNITO_DOMAIN/oauth2/token' , {
@@ -173,7 +176,7 @@ async function getCognitoToken() {
173176 formData .append (' grant_type' , ' client_credentials' );
174177 formData .append (' client_id' , ' YOUR_CLIENT_ID' );
175178 formData .append (' client_secret' , ' YOUR_CLIENT_SECRET' );
176- formData .append (' scope' , ' backend -api-v3-admins/auths:read ' );
179+ formData .append (' scope' , ' cognito -api-scope ' );
177180
178181 try {
179182 const response = await fetch (' https://YOUR_COGNITO_DOMAIN/oauth2/token' , {
@@ -210,7 +213,7 @@ getCognitoToken();
210213 "access_token" : " eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..." ,
211214 "token_type" : " Bearer" ,
212215 "expires_in" : 3600 ,
213- "scope" : " backend -api-v3-admins/auths:read "
216+ "scope" : " cognito -api-scope "
214217}
215218```
216219
@@ -249,7 +252,7 @@ NODE_ENV=development
249252COGNITO_DOMAIN=your-dev-cognito-domain.auth.region.amazoncognito.com
250253COGNITO_CLIENT_ID=your_dev_client_id
251254COGNITO_CLIENT_SECRET=your_dev_client_secret
252- COGNITO_SCOPE=backend -api-v3-admins/auths:read
255+ COGNITO_SCOPE=cognito -api-scope
253256API_BASE_URL=http://localhost:3000/v1
254257```
255258
@@ -261,7 +264,7 @@ NODE_ENV=staging
261264COGNITO_DOMAIN=your-staging-cognito-domain.auth.region.amazoncognito.com
262265COGNITO_CLIENT_ID=your_staging_client_id
263266COGNITO_CLIENT_SECRET=your_staging_client_secret
264- COGNITO_SCOPE=backend -api-v3-admins/auths:read
267+ COGNITO_SCOPE=cognito -api-scope
265268API_BASE_URL=https://staging-api.example.com/v1
266269```
267270
@@ -273,7 +276,7 @@ NODE_ENV=production
273276COGNITO_DOMAIN=your-prod-cognito-domain.auth.region.amazoncognito.com
274277COGNITO_CLIENT_ID=your_prod_client_id
275278COGNITO_CLIENT_SECRET=your_prod_client_secret
276- COGNITO_SCOPE=backend -api-v3-admins/auths:read
279+ COGNITO_SCOPE=cognito -api-scope
277280API_BASE_URL=https://api.example.com/v1
278281```
279282
0 commit comments