Skip to main content
Glama
test-dev-login.cjs2.41 kB
#!/usr/bin/env node const axios = require('axios'); async function testCognitoLogin(baseUrl, email, password, envName) { console.log(`\n=== Testing ${envName} - Cognito Authentication ===\n`); console.log('Base URL:', baseUrl); console.log('Email:', email); console.log('Password length:', password.length); const fullUrl = `${baseUrl}/users/signin`; const requestBody = { username: email, // Cognito uses 'username' not 'email' password: password }; console.log('Full URL:', fullUrl); console.log('Request Body:', JSON.stringify(requestBody, null, 2)); console.log('\nAttempting Cognito login...\n'); try { const response = await axios.post(fullUrl, requestBody, { headers: { 'Content-Type': 'application/json' }, validateStatus: () => true // Don't throw on any status }); console.log('✅ Response received'); console.log('Status:', response.status); console.log('Status Text:', response.statusText); console.log('\nResponse Headers:'); console.log(JSON.stringify(response.headers, null, 2)); console.log('\nResponse Data:'); console.log(JSON.stringify(response.data, null, 2)); if (response.status === 200) { console.log('\n✅ LOGIN SUCCESSFUL!'); if (response.data.jwtToken) { console.log('JWT Token received (length):', response.data.jwtToken.length); } if (response.data.idToken) { console.log('ID Token received (length):', response.data.idToken.length); } } else { console.log('\n❌ LOGIN FAILED'); console.log('Error type:', response.data.type); console.log('Error message:', response.data.message || response.data.clientMessage); } } catch (error) { console.error('\n❌ REQUEST FAILED'); console.error('Error:', error.message); if (error.response) { console.error('Status:', error.response.status); console.error('Data:', error.response.data); } } } async function runTests() { // Test 1: SAOLA user in Production (Cognito) await testCognitoLogin( 'https://api.umbrellacost.io/api/v1', 'david+saola@umbrellacost.com', 'Dsamsung1!', 'Production - SAOLA' ); // Test 2: Elisha user in Dev (Cognito) await testCognitoLogin( 'https://api.dev.umbrellacost.dev/api/v1', 'elisha+testmcpdev@anodot.com', 'Test123!', 'Dev - Elisha' ); } runTests();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/daviddraiumbrella/invoice-monitoring'

If you have feedback or need assistance with the MCP directory API, please join our Discord server