mirror of
https://github.com/awslabs/amazon-bedrock-agentcore-samples.git
synced 2025-09-08 20:50:46 +00:00
51 lines
1.6 KiB
Bash
51 lines
1.6 KiB
Bash
|
#!/bin/bash
|
||
|
# Bedrock AgentCore Gateway - Okta PKCE Local Development Setup
|
||
|
|
||
|
PROJECT_DIR="/Users/rohillao/Documents/Volumes/devenv/projects/local/Rough/07-Operational-Support-Lambda-Web-Adapter/okta-auth"
|
||
|
|
||
|
echo "🚀 Setting up Bedrock AgentCore Gateway Okta PKCE Local Development Environment"
|
||
|
|
||
|
# Check for nginx
|
||
|
if ! command -v nginx &> /dev/null; then
|
||
|
echo "❌ nginx not found. Please install nginx first."
|
||
|
echo " macOS: brew install nginx"
|
||
|
echo " Ubuntu: sudo apt-get install nginx"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# Check if nginx is running
|
||
|
if ! pgrep nginx > /dev/null; then
|
||
|
echo "⚠️ nginx is not running. Starting nginx..."
|
||
|
sudo nginx
|
||
|
fi
|
||
|
|
||
|
# Start nginx with our configuration
|
||
|
echo "🔄 Starting nginx with Okta PKCE configuration..."
|
||
|
sudo nginx -c "$PROJECT_DIR/nginx/okta-local.conf"
|
||
|
|
||
|
# Check if nginx started successfully
|
||
|
if [ $? -eq 0 ]; then
|
||
|
echo "✅ nginx started successfully with Okta PKCE configuration"
|
||
|
echo "🌐 Open http://localhost:8080/okta-auth/ in your browser"
|
||
|
else
|
||
|
echo "❌ Failed to start nginx with Okta PKCE configuration"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
echo ""
|
||
|
echo "🔧 Next steps:"
|
||
|
echo "1. Update iframe-oauth-flow.html with your Okta settings:"
|
||
|
echo " - domain: YOUR_OKTA_DOMAIN.okta.com"
|
||
|
echo " - clientId: YOUR_CLIENT_ID"
|
||
|
echo " - bedrock_agentcore URLs: YOUR_GATEWAY_ID and YOUR_REGION"
|
||
|
echo ""
|
||
|
echo "2. Update Okta redirect URIs to include:"
|
||
|
echo " - http://localhost:8080/okta-auth/"
|
||
|
echo ""
|
||
|
echo "3. To stop nginx when done:"
|
||
|
echo " sudo nginx -s stop"
|
||
|
echo ""
|
||
|
echo "4. To view nginx logs:"
|
||
|
echo " tail -f /usr/local/var/log/nginx/error.log"
|
||
|
echo ""
|