Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refresh multi tenancy and OIDC doc #4024

Merged
merged 49 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2b756a5
refresh multi tenancy and OIDC doc
achmelo Nov 28, 2024
90de9de
OIDC auth sequence update
achmelo Nov 28, 2024
792ff26
address review comments
achmelo Nov 28, 2024
097e997
formatting refactor
janan07 Nov 28, 2024
8d687bb
Merge branch 'reboot/oidc-doc-update' of https://github.com/zowe/docs…
janan07 Nov 28, 2024
0effeb8
Merge branch 'docs-staging' into reboot/oidc-doc-update
janan07 Nov 28, 2024
549d772
code review
achmelo Nov 29, 2024
f6007ca
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
achmelo Nov 29, 2024
88ccb09
formatting
achmelo Nov 29, 2024
13c006d
use 1 schema with alternatives
achmelo Nov 29, 2024
a36dbb9
code review
achmelo Nov 29, 2024
d610c33
Replace removed calendar with current one
balhar-jakub Nov 29, 2024
1bafb52
Merge branch 'docs-staging' into reboot/oidc-doc-update
balhar-jakub Nov 29, 2024
168e258
Fix Further Links
balhar-jakub Nov 29, 2024
8b7f00a
Fix cipher related link
balhar-jakub Nov 29, 2024
6bcb96d
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
balhar-jakub Nov 29, 2024
9b4aa8b
Fix 2.16 and Move to new Office Hours
balhar-jakub Nov 29, 2024
eb84123
Remove nonexistent links
balhar-jakub Nov 29, 2024
e89ef6f
Fix last CICS link
balhar-jakub Nov 29, 2024
e8bdc98
update diagram, code review comments
achmelo Dec 2, 2024
35d1575
describe steps in the diagram
achmelo Dec 5, 2024
354922e
language / formatting refactor
janan07 Dec 5, 2024
4a95986
minor language refactoring
janan07 Dec 5, 2024
09353e1
registry desc
achmelo Dec 5, 2024
fda7fb6
escape HTML signs
achmelo Dec 5, 2024
390b37f
update diagram and steps description
achmelo Dec 5, 2024
b02b2c9
add missing sign
achmelo Dec 5, 2024
1818e6f
remove obsolete prereq
achmelo Dec 6, 2024
a2a0c0d
restructure config section
achmelo Dec 6, 2024
7dbf3b6
update oidc options
richard-salac Dec 6, 2024
ad5e374
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
richard-salac Dec 6, 2024
308b55a
clarify oidc resource server feature toggle docs
richard-salac Dec 6, 2024
367fd1c
update anchors
achmelo Dec 6, 2024
a18a905
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
achmelo Dec 6, 2024
44ce28e
minor fix
janan07 Dec 6, 2024
d127b1c
add collapsible sections
janan07 Dec 6, 2024
031c56b
fix punctuation
janan07 Dec 6, 2024
aa884a5
remove duplicate content
achmelo Dec 6, 2024
883c85a
fix content table
achmelo Dec 6, 2024
0778db7
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
achmelo Dec 6, 2024
1b81119
remove word
janan07 Dec 6, 2024
2258719
formatting refactor
janan07 Dec 6, 2024
9041ced
remove broken link
achmelo Dec 9, 2024
2710927
Merge remote-tracking branch 'origin/reboot/oidc-doc-update' into reb…
achmelo Dec 9, 2024
9f1fea2
improve format and add collapsible content
janan07 Dec 9, 2024
41972ef
fix TOC
janan07 Dec 9, 2024
df670b4
fix links
achmelo Dec 9, 2024
0993001
fix anchor links
janan07 Dec 9, 2024
fd059f3
fix anchor links
janan07 Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/diagrams/apiml-oidc-auth-no-mf-id-seq.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@startuml
'https://plantuml.com/sequence-diagram

autonumber
actor User
actor "User Agent" as Agent
actor OIDC as OIDC
actor "API ML GW" as GW

User -> Agent: Do stuff
Agent -> GW: /gateway/oauth2/authorization/<provider-id>
GW -> OIDC: Initiate OIDC flow [client_id, client_secret]
loop [MFA]
OIDC -> Agent: Request user credentials
User <-> Agent: Provide credentials
Agent -> OIDC: Validate credentials
end
OIDC --> GW: Return Auth Code / JWTs[access,refresh,identity]
GW -> Agent: set-cookie access token
Agent -> GW: Request resources [access token]
group validate
GW -> GW: Validate access token
GW -> OIDC: Validate access token
end
alt Validation success
GW -> GW: Cache access token validity
GW -> SAF: Map distributed ID to mainframe ID
SAF -> GW: No mapping exists for distributed ID
GW -> Service: call API service with OIDC-token
Service -> Service: Validate access token
Service --> GW: return Response
end
GW --> Agent: Response


@enduml
23 changes: 12 additions & 11 deletions docs/diagrams/apiml-oidc-auth-seq.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@
autonumber
actor User
actor "User Agent" as Agent
actor "Client App" as Client
actor OIDC as OIDC
actor "API ML GW" as GW

User -> Agent: Do stuff
Agent -> Client: Open Client App
Client -> OIDC: Initiate OIDC flow [client_id, client_secret]
Agent -> GW: /gateway/oauth2/authorization/<provider-id>
GW -> OIDC: Initiate OIDC flow [client_id, client_secret]
loop [MFA]
OIDC -> Agent: Request user credentials
User <-> Agent: Provide credentials
Agent -> OIDC: Validate credentials
end
OIDC --> Client: Return Auth Code / JWTs[access,refresh,identity]
Client -> GW: Request resources [JWT AT]
OIDC --> GW: Return Auth Code / JWTs[access,refresh,identity]
GW -> Agent: set-cookie access token
achmelo marked this conversation as resolved.
Show resolved Hide resolved
Agent -> GW: Request resources [access token]
group validate
GW -> GW: Validate AT
GW -> OIDC: Validate AT
GW -> GW: Validate access token
GW -> OIDC: Validate access token
end
alt Validation success
GW -> GW: Cache AT validity
GW -> GW: Cache access token validity
GW -> SAF: Map distributed ID to mainframe ID
GW -> GW: Create Zowe JWT
GW -> Service: call API service
GW -> Service: call API service with Zowe JWT
achmelo marked this conversation as resolved.
Show resolved Hide resolved
Service -> Service: Validate JWT
Service --> GW: return Response
achmelo marked this conversation as resolved.
Show resolved Hide resolved
end
GW --> Client: Response
Client --> Agent: Response
GW --> Agent: Response


@enduml
161 changes: 122 additions & 39 deletions docs/extend/extend-apiml/api-mediation-oidc-authentication.md

Large diffs are not rendered by default.

achmelo marked this conversation as resolved.
Show resolved Hide resolved
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/api-mediation/apiml-oidc-auth-seq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 4 additions & 86 deletions docs/user-guide/api-mediation/api-mediation-multi-tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ Use the following example as a template for how to set the value for this proper
```
components.gateway.apiml.service.additionalRegistration:
# central API ML (in HA, for non-HA mode use only 1 hostname)
- discoveryServiceUrls: https://sys1:{discoveryServicePort}/eureka/,https://sys2:{discoveryServicePort}/eureka/
routes:
- gatewayUrl: /
serviceUrl: /
- discoveryServiceUrls: https://sys1:{discoveryServicePort}/eureka/,https://sys2:{discoveryServicePort}/eureka/
```

```
Expand Down Expand Up @@ -117,12 +114,9 @@ Use the following example as a template for how to set the value of this propert

**Example:**
```
components.cloud-gateway.apiml.service.additionalRegistration:
# central API ML (in HA, for non-HA mode use only 1 hostname)
- discoveryServiceUrls: https://sys1:{discoveryServicePort}/eureka/,https://sys2:{discoveryServicePort}/eureka/
routes:
- gatewayUrl: /
serviceUrl: /
components.gateway.apiml.service.additionalRegistration:
# central API ML (in HA, for non-HA mode use only 1 hostname)
- discoveryServiceUrls: https://sys1:{discoveryServicePort}/eureka/,https://sys2:{discoveryServicePort}/eureka/
achmelo marked this conversation as resolved.
Show resolved Hide resolved
```

#### Dynamic configuration: Environment variables
Expand All @@ -133,8 +127,6 @@ The previous example can be substituted with the following variables:

```
ZWE_CONFIGS_APIML_SERVICE_ADDITIONALREGISTRATION_0_DISCOVERYSERVICEURLS=https://sys1:{discoveryServicePort}/eureka/,https://sys2:{discoveryServicePort}/eureka/
ZWE_CONFIGS_APIML_SERVICE_ADDITIONALREGISTRATION_0_ROUTES_0_GATEWAYURL=/
ZWE_CONFIGS_APIML_SERVICE_ADDITIONALREGISTRATION_0_ROUTES_0_SERVICEURL=/
```

This Zowe configuration transforms the zowe.yaml configuration file into the environment variables described previously.
Expand Down Expand Up @@ -463,81 +455,7 @@ Should contain information about a specific service in a specific domain

Use the `/registry` endpoint to validate successful configuration. The response should contain all Domain API MLs represented by `apimlId`, and information about onboarded services.

## Gateway static definition example (deprecated)

The Gateway static definition file should be stored together with other statically onboarded services. The default location is `/zowe/runtime/instance/workspace/api-mediation/api-defs/`.
There is no naming restriction of the filename, but the file extension must be `yml`.

**Example:**
```
#
# Static definition of "discoverable-client" as "staticclient"
#
# This file provides static API service definition in YAML format.
# It is loaded by the Discovery Service during its startup.
#
services:
- serviceId: GATEWAY # unique lowercase ID of the service
catalogUiTileId: static # ID of the API Catalog UI tile (visual grouping of the services)
title: Statically Defined API Service # Title of the service in the API catalog
description: Sample to demonstrate how to add an API service with Swagger to API Catalog using a static YAML definition # Description of the service in the API catalog
instanceBaseUrls: # list of base URLs for each instance
- https://sys1:{gatewayPort}/ # scheme://hostname:port/contextPath
homePageRelativeUrl: / # Normally used for informational purposes for other services to use it as a landing page
statusPageRelativeUrl: /application/info # Appended to the instanceBaseUrl
healthCheckRelativeUrl: /application/health # Appended to the instanceBaseUrl
routes:
- gatewayUrl: api/v1 # [api/ui/ws]/v{majorVersion}
serviceRelativeUrl: /api/v1 # relativePath that is added to baseUrl of an instance
- gatewayUrl: ui/v1
serviceRelativeUrl: /
- gatewayUrl: ws/v1
serviceRelativeUrl: /ws
# List of APIs provided by the service (currently only one is supported):
apiInfo:
- apiId: zowe.apiml.gateway
gatewayUrl: api/v1
swaggerUrl: https://sys1:{discoverableClientPort}/discoverableclient/v2/api-docs
customMetadata:
apiml:
service.apimlId: apiml1
okToRetryOnAllOperations: true


- serviceId: GATEWAY # unique lowercase ID of the service
catalogUiTileId: static # ID of the API Catalog UI tile (visual grouping of the services)
title: Statically Defined API Service # Title of the service in the API catalog
description: Sample to demonstrate how to add an API service with Swagger to API Catalog using a static YAML definition # Description of the service in the API catalog
instanceBaseUrls: # list of base URLs for each instance
- https://sys2:{gatewayPort}/ # scheme://hostname:port/contextPath
homePageRelativeUrl: / # Normally used for informational purposes for other services to use it as a landing page
statusPageRelativeUrl: /application/info # Appended to the instanceBaseUrl
healthCheckRelativeUrl: /application/health # Appended to the instanceBaseUrl
routes:
- gatewayUrl: api/v1 # [api/ui/ws]/v{majorVersion}
serviceRelativeUrl: /api/v1 # relativePath that is added to baseUrl of an instance
- gatewayUrl: ui/v1
serviceRelativeUrl: /
- gatewayUrl: ws/v1
serviceRelativeUrl: /ws
# List of APIs provided by the service (currently only one is supported):
apiInfo:
- apiId: zowe.apiml.gateway
gatewayUrl: api/v1
swaggerUrl: https://sys2:{discoverableClientPort}/discoverableclient/v2/api-docs
customMetadata:
apiml:
service.apimlId: apiml2
okToRetryOnAllOperations: true


# List of tiles that can be used by services defined in the YAML file:
catalogUiTiles:
static:
title: Static API Services
description: Services which demonstrate how to make an API service discoverable in the APIML ecosystem using YAML definitions

```
## Troubleshooting multitenancy configuration

### ZWESG100W
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,23 @@ in isolated sysplex environments. Data from the Central Discovery Service can th

Follow these steps to register with additional Discovery Services:

1. Open the `zowe.yaml` configuration file.
2. Add the property `components.gateway.apiml.service.additionalRegistration` and set the value to a list of Discovery service clusters to additional Disovery Services.
1. Open the `zowe.yaml` configuration file.
2. Add the property `components.gateway.apiml.service.additionalRegistration` and set the value to a list of Discovery service clusters to additional Disovery Services.

**Example:**
```
components.gateway.apiml.service.additionalRegistration:
<!-- central APIML -->
- discoveryServiceUrls: https://sys1:10011/eureka/,https://sys1:10021/eureka/
routes:
achmelo marked this conversation as resolved.
Show resolved Hide resolved
gatewayUrl: /
serviceUrl: /
<!-- APIML on System 2 -->
- discoveryServiceUrls: https://sys2:10011/eureka/,https://sys2:10021/eureka/
routes:
gatewayUrl: /
serviceUrl: /
<!-- APIML on System 3 -->
- discoveryServiceUrls: https://sys3:10011/eureka/,https://sys3:10021/eureka/
routes:
gatewayUrl: /
serviceUrl: /
```
3. Restart Zowe.
3. Add property `components.gateway.apimlId` and set the value to a unique string to identify gateway for routing.

**Example:**
```
components.gateway.apimlId: apiml1
achmelo marked this conversation as resolved.
Show resolved Hide resolved
```
4. Restart Zowe.
Loading