diff --git a/bin/cg-bootstrap-space.sh b/bin/cg-bootstrap-space.sh index 0d3648c6..8c01b7b2 100755 --- a/bin/cg-bootstrap-space.sh +++ b/bin/cg-bootstrap-space.sh @@ -39,6 +39,7 @@ cf bind-security-group public_networks_egress $org --space $space # Services cf create-service aws-elasticache-redis $redis_plan smartpay-training-redis cf create-service aws-rds $rds_plan smartpay-training-db +cf create-service cloud-gov-identity-provider oauth-client smartpay-training-oauth-client # Secrets cf create-user-provided-service smartpay-training-secrets diff --git a/bin/cg-create-identity-service.sh b/bin/cg-create-identity-service.sh deleted file mode 100755 index c52fc335..00000000 --- a/bin/cg-create-identity-service.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash - -# Creates an OAuth provider service in cloud.gov - -set -e - -if [ -z "$2" ] ; then - echo "Usage: $0 SPACE FRONT_END_BASE_URL" - echo - echo "Example: $0 prod https://training.smartpay.gsa.gov" - exit 1 -fi - -org="gsa-smartpay" -app_name="smartpay-training" -space=$1 -redirect_url=${2%/}/auth_callback -post_logout_url=${2%/} -service_instance_name="smartpay-training-oauth-client" -service_key_name="smartpay-training-oauth-key" - -echo "Creating identity provider service in space: $space" -echo "Service instance name: ${service_instance_name}" -echo "Service key name: ${service_key_name}" -echo "Redirect URL: ${redirect_url}" -echo "Post-logout URL: ${post_logout_url}" -echo - -cf target -o ${org} -s ${space} - -# Create identity provider -cf create-service cloud-gov-identity-provider oauth-client ${service_instance_name} - -# Create service key -cf create-service-key smartpay-training-oauth-client ${service_key_name} \ - -c "{\"redirect_uri\": [\"${redirect_url}\", \"${post_logout_url}\"]}" - -echo If needed, you can retrieve the client_id and client_secret with: -echo cf service-key smartpay-training-oauth-client ${service_key_name} diff --git a/manifest-vars.dev.yml b/manifest-vars.dev.yml index afa5c7d4..6adaf4d5 100644 --- a/manifest-vars.dev.yml +++ b/manifest-vars.dev.yml @@ -1,3 +1,6 @@ env: dev memory: 256M instances: 1 +oauth_redirect_uri: + - https://federalist-2e11f2c8-970f-44f5-acc8-b47ef6c741ad.sites.pages.cloud.gov/site/gsa/smartpay-training/ + - https://federalist-2e11f2c8-970f-44f5-acc8-b47ef6c741ad.sites.pages.cloud.gov/site/gsa/smartpay-training/auth_callback diff --git a/manifest-vars.prod.yml b/manifest-vars.prod.yml index 5d064078..01a6a4f7 100644 --- a/manifest-vars.prod.yml +++ b/manifest-vars.prod.yml @@ -1,3 +1,6 @@ env: prod memory: 4G instances: 2 +oauth_redirect_uri: + - https://training.smartpay.gsa.gov + - https://training.smartpay.gsa.gov/auth_callback diff --git a/manifest-vars.staging.yml b/manifest-vars.staging.yml index 57542126..bcc08107 100644 --- a/manifest-vars.staging.yml +++ b/manifest-vars.staging.yml @@ -1,3 +1,6 @@ env: staging memory: 256M instances: 2 +oauth_redirect_uri: + - https://training.smartpay.gsa.gov + - https://training.smartpay.gsa.gov/auth_callback diff --git a/manifest-vars.test.yml b/manifest-vars.test.yml index 52be0e6e..b4d1bc16 100644 --- a/manifest-vars.test.yml +++ b/manifest-vars.test.yml @@ -1,3 +1,6 @@ env: test memory: 256M instances: 1 +oauth_redirect_uri: + - https://training.smartpay.gsa.gov + - https://training.smartpay.gsa.gov/auth_callback diff --git a/manifest.yml b/manifest.yml index 2fe6cbb5..d480603d 100644 --- a/manifest.yml +++ b/manifest.yml @@ -8,7 +8,9 @@ applications: - route: smartpay-training-((env)).app.cloud.gov instances: ((instances)) services: - - smartpay-training-db - - smartpay-training-redis - - smartpay-training-secrets - - smartpay-training-oauth-client + - name: smartpay-training-db + - name: smartpay-training-redis + - name: smartpay-training-secrets + - name: smartpay-training-oauth-client + parameters: + redirect_uri: ((oauth_redirect_uri))