You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/spring-cloud/how-to-set-up-sso-with-azure-ad.md
+4-5Lines changed: 4 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
-
title: How to set up Single Sign-on with Azure AD for Spring Cloud Gateway and API Portal for Tanzu
2
+
title: How to set up single sign-on with Azure AD for Spring Cloud Gateway and API Portal for Tanzu
3
3
titleSuffix: Azure Spring Apps Enterprise Tier
4
-
description: How to set up Single Sign-on with Azure Active Directory for Spring Cloud Gateway and API Portal for Tanzu with Azure Spring Apps Enterprise Tier.
4
+
description: How to set up single sign-on with Azure Active Directory for Spring Cloud Gateway and API Portal for Tanzu with Azure Spring Apps Enterprise Tier.
5
5
author: karlerickson
6
6
ms.author: ninpan
7
7
ms.service: spring-cloud
@@ -10,18 +10,17 @@ ms.date: 05/20/2022
10
10
ms.custom: devx-track-java, devx-track-azurecli
11
11
---
12
12
13
-
# Set up Single Sign-on using Azure Active Directory for Spring Cloud Gateway and API Portal
13
+
# Set up single sign-on using Azure Active Directory for Spring Cloud Gateway and API Portal
This article shows you how to configure Single Sign-on (SSO) for Spring Cloud Gateway or API Portal using the Azure Active Directory (Azure AD) as an OpenID identify provider.
17
+
This article shows you how to configure single sign-on (SSO) for Spring Cloud Gateway or API Portal using the Azure Active Directory (Azure AD) as an OpenID identify provider.
18
18
19
19
## Prerequisites
20
20
21
21
- An Enterprise tier instance with Spring Cloud Gateway or API portal enabled. For more information, see [Quickstart: Provision an Azure Spring Apps service instance using the Enterprise tier](quickstart-provision-service-instance-enterprise.md).
22
22
- Sufficient permissions to manage Azure AD applications.
23
23
24
-
25
24
To enable SSO for Spring Cloud Gateway or API Portal, you need the following four properties configured:
This article shows you how to use API portal for VMware Tanzu® with Azure Spring Apps Enterprise Tier.
21
21
22
-
[API portal](https://docs.vmware.com/en/API-portal-for-VMware-Tanzu/1.0/api-portal/GUID-index.html) is one of the commercial VMware Tanzu components. API portal supports viewing API definitions from [Spring Cloud Gateway for VMware Tanzu®](./how-to-use-enterprise-spring-cloud-gateway.md) and testing of specific API routes from the browser. It also supports enabling Single Sign-on authentication via configuration.
22
+
[API portal](https://docs.vmware.com/en/API-portal-for-VMware-Tanzu/1.0/api-portal/GUID-index.html) is one of the commercial VMware Tanzu components. API portal supports viewing API definitions from [Spring Cloud Gateway for VMware Tanzu®](./how-to-use-enterprise-spring-cloud-gateway.md) and testing of specific API routes from the browser. It also supports enabling single sign-on (SSO) authentication via configuration.
23
23
24
24
## Prerequisites
25
25
@@ -34,9 +34,9 @@ This article shows you how to use API portal for VMware Tanzu® with Azure Sprin
34
34
35
35
The following sections describe configuration in API portal.
36
36
37
-
### Configure single Sign-on (SSO)
37
+
### Configure single sign-on (SSO)
38
38
39
-
API portal supports authentication and authorization using single Sign-on (SSO) with an OpenID identity provider (IdP) that supports the OpenID Connect Discovery protocol.
39
+
API portal supports authentication and authorization using single sign-on (SSO) with an OpenID identity provider (IdP) that supports the OpenID Connect Discovery protocol.
40
40
41
41
> [!NOTE]
42
42
> Only authorization servers supporting the OpenID Connect Discovery protocol are supported. Be sure to configure the external authorization server to allow redirects back to the gateway. Refer to your authorization server's documentation and add `https://<gateway-external-url>/login/oauth2/code/sso` to the list of allowed redirect URIs.
@@ -48,7 +48,7 @@ API portal supports authentication and authorization using single Sign-on (SSO)
48
48
| clientSecret | Yes | The OpenID Connect client secret provided by your IdP |
49
49
| scope | Yes | A list of scopes to include in JWT identity tokens. This list should be based on the scopes allowed by your identity provider |
50
50
51
-
To set up SSO with Azure AD, see [How to set up Single Sign-on with Azure AD for Spring Cloud Gateway and API Portal for Tanzu](./how-to-set-up-sso-with-azure-ad.md).
51
+
To set up SSO with Azure AD, see [How to set up single sign-on with Azure AD for Spring Cloud Gateway and API Portal for Tanzu](./how-to-set-up-sso-with-azure-ad.md).
52
52
53
53
> [!NOTE]
54
54
> If you configure the wrong SSO property, such as the wrong password, you should remove the entire SSO property and re-add the correct configuration.
@@ -75,7 +75,73 @@ You can also use the Azure CLI to assign a public endpoint with the following co
75
75
az spring api-portal update --assign-endpoint
76
76
```
77
77
78
-
## View the route information through API portal
78
+
## Configure API routing with OpenAPI Spec on Spring Cloud Gateway for Tanzu
79
+
80
+
This section describes how to view and try out APIs with schema definitions in API portal. Use the following steps to configure API routing with an OpenAPI spec URL on Spring Cloud Gateway for Tanzu.
81
+
82
+
1. Create an app in Azure Spring Apps that the gateway will route traffic to.
83
+
84
+
1. Generate the OpenAPI definition and get the URI to access it. The following two URI options are accepted:
85
+
86
+
- The first option is to use a publicly accessible endpoint like the URI `https://petstore3.swagger.io/api/v3/openapi.json`, which includes the OpenAPI specification.
87
+
- The second option is to put the OpenAPI definition in the relative path of the app in Azure Spring Apps, and construct the URI in the format `http://<app-name>/<relative-path-to-OpenAPI-spec>`. You can choose tools like `SpringDocs` to generate the OpenAPI specification automatically, so the URI can be like `http://<app-name>/v3/api-docs`.
88
+
89
+
1. Use the following command to assign a public endpoint to the gateway to access it.
90
+
91
+
```azurecli
92
+
az spring gateway update --assign-endpoint
93
+
```
94
+
95
+
1. Use the following command to configure Spring Cloud Gateway for Tanzu properties:
96
+
97
+
```azurecli
98
+
az spring gateway update \
99
+
--api-description "<api-description>" \
100
+
--api-title "<api-title>" \
101
+
--api-version "v0.1" \
102
+
--server-url "<endpoint-in-the-previous-step>" \
103
+
--allowed-origins "*"
104
+
```
105
+
106
+
1. Configure routing rules to apps.
107
+
108
+
To create rules to access the app in Spring Cloud Gateway for Tanzu route configuration, save the following contents to the *sample.json* file.
The `open_api.uri` value is the public endpoint or URI constructed in the second step above. You can add predicates and filters for paths defined in your OpenAPI specification.
132
+
133
+
Use the following command to apply the rule to the app created in the first step:
134
+
135
+
```azurecli
136
+
az spring gateway route-config create \
137
+
--name sample \
138
+
--app-name <app-name> \
139
+
--routes-file sample.json
140
+
```
141
+
142
+
1. Check the response of the created routes. You can also view the routes in the portal.
143
+
144
+
## View exposed APIs in API portal
79
145
80
146
> [!NOTE]
81
147
> It takes several minutes to sync between Spring Cloud Gateway for Tanzu and API portal.
@@ -84,13 +150,12 @@ Select the `endpoint URL` to go to API portal. You'll see all the routes configu
84
150
85
151
:::image type="content" source="media/enterprise/how-to-use-enterprise-api-portal/api-portal.png" alt-text="Screenshot of A P I portal showing configured routes.":::
86
152
87
-
## Try APIs using API portal
153
+
## Try out APIs in API portal
88
154
89
-
> [!NOTE]
90
-
> Only `GET` operations are supported in the public preview.
155
+
Use the following steps to try out APIs:
91
156
92
157
1. Select the API you would like to try.
93
-
1. Select **EXECUTE** and the response will be shown.
158
+
1. Select **EXECUTE**, and the response will be shown.
94
159
95
160
:::image type="content" source="media/enterprise/how-to-use-enterprise-api-portal/api-portal-tryout.png" alt-text="Screenshot of A P I portal.":::
0 commit comments