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

procedures: native user auth docs #2187

Merged
merged 37 commits into from
Dec 22, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1b93390
native user auth docs
sparkoo Dec 8, 2021
89b4f18
fix lang errors
sparkoo Dec 8, 2021
707daac
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 8, 2021
5394b64
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
caf2214
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
e2a698e
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
e4d96e8
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
7bee785
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 9, 2021
0c9005c
Update Spelling.yml
themr0c Dec 9, 2021
fffdb05
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 9, 2021
272cadd
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 9, 2021
9555318
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 10, 2021
d2e48b3
update devworkspace installation doc
sparkoo Dec 10, 2021
42998dc
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 10, 2021
ebfcdce
link to kubernetes oidc docs, cleanup
sparkoo Dec 10, 2021
ec8c196
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 16, 2021
51d51da
Merge branch 'master' into gh20847-nativeUserAuth
themr0c Dec 16, 2021
f575033
Apply suggestions from code review
themr0c Dec 21, 2021
7b1b6cf
Apply suggestions from code review
themr0c Dec 21, 2021
1a5762c
Add links as attributes
themr0c Dec 21, 2021
e1871dc
Apply suggestions from code review
themr0c Dec 21, 2021
5353ab3
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
6209401
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
a6545ce
Apply suggestions from code review
themr0c Dec 21, 2021
9738741
Update modules/installation-guide/partials/proc_enabling-dev-workspac…
themr0c Dec 21, 2021
3b91a8a
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
46b9f32
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
fae8a58
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
ff7eb5d
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
972e96e
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
f6c3fb3
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
e64d989
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
e8ee0bc
Update modules/administration-guide/partials/proc_configuring-minikub…
themr0c Dec 21, 2021
065c669
Update modules/administration-guide/partials/con_gateway.adoc
themr0c Dec 21, 2021
fa5d00a
grammar fixes
sparkoo Dec 22, 2021
a38244f
Merge branch 'master' into gh20847-nativeUserAuth
sparkoo Dec 22, 2021
67e99ff
Apply suggestions from code review
themr0c Dec 22, 2021
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
1 change: 1 addition & 0 deletions modules/administration-guide/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,4 @@
** xref:configuring-authorization.adoc[]
** xref:configuring-openshift-oauth.adoc[]
** xref:removing-user-data.adoc[]
** xref:configuring-minikube-github-authentication.adoc[]
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
themr0c marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[id="configuring-openshift-oauth"]
// = Configuring OpenShift OAuth
:navtitle: Configuring Minikube Github Authentication
themr0c marked this conversation as resolved.
Show resolved Hide resolved
:keywords: administration-guide, configuring-openshift-oauth
:page-aliases: .:configuring-minikube-github-authentication

include::partial$proc_configuring-minikube-github-authentication.adoc[]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[id="configuring-openshift-oauth"]
// = Configuring OpenShift OAuth
:navtitle: Configuring OpenShift OAuth
:keywords: end-user-guide, configuring-openshift-oauth
:keywords: administration-guide, configuring-openshift-oauth
:page-aliases: .:configuring-openshift-oauth

include::partial$proc_configuring-openshift-oauth.adoc[]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[id="managing-identities-and-authorizations"]
// = Managing identities and authorizations
:navtitle: Managing identities and authorizations
:keywords: end-user-guide, managing-identities-and-authorizations
:keywords: administration-guide, managing-identities-and-authorizations
:page-aliases: .:managing-identities-and-authorizations

include::partial$assembly_managing-identities-and-authorizations.adoc[]
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ include::partial$proc_listing-che-permissions.adoc[leveloffset=+1]

include::partial$proc_assigning-che-permissions.adoc[leveloffset=+1]

include::partial$con_devworkspace_auth.adoc[leveloffset=+1]


:context: {parent-context-of-authorizing-users}
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ This section describes different aspects of managing identities and authorizatio
* xref:configuring-authorization.adoc[]
* xref:removing-user-data.adoc[]
* xref:configuring-openshift-oauth.adoc[]
* xref:configuring-minikube-github-authentication.adoc[]

:context: {parent-context-of-managing-identities-and-authorizations}
3 changes: 3 additions & 0 deletions modules/administration-guide/partials/con_che-operator.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Creates and controls the necessary {orch-name} objects to run a {prod-short} ins
`CheCluster` custom resource (CR)::
On a cluster with the {prod-short} operator, it is possible to create a `CheCluster` custom resource (CR). The {prod-short} operator ensure full lifecycle management of the {prod-short} server components on this {prod-short} instance.

The {prod-short} operator is also provides routing for {devworkspace} by configuring the `che-gateway`.
themr0c marked this conversation as resolved.
Show resolved Hide resolved
themr0c marked this conversation as resolved.
Show resolved Hide resolved
themr0c marked this conversation as resolved.
Show resolved Hide resolved

.Additional resources

* xref:installation-guide:configuring-the-che-installation.adoc[]
* xref:installation-guide:installing-che.adoc[]
* xref:administration-guide:gateway.adoc[]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment above.

themr0c marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 6 additions & 1 deletion modules/administration-guide/partials/con_gateway.adoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
[id="gateway_{context}"]
= Gateway

The {prod-short} gateway is a Traefik instance applying {orch-name} Role based access control (RBAC) policies to control access to any {prod-short} resource.
The {prod-short} gateway consists of 3 main parts:

* *link:https://github.com/traefik/traefik[Traefik]* instance responsible for requests routing
* *link:https://github.com/oauth2-proxy/oauth2-proxy[OAuth2-proxy]* ensuring authentication and initiating OAuth flow
* *link:https://github.com/brancz/kube-rbac-proxy[kube-rbac-proxy]* applying {orch-name} Role based access control (RBAC) policies to control access to any {prod-short} resource.
themr0c marked this conversation as resolved.
Show resolved Hide resolved

themr0c marked this conversation as resolved.
Show resolved Hide resolved
The {prod-short} operator manages it as the `che-gateway` Deployment.

It controls access to:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[id="configuring-minikube-github-authentication_{context}"]
= Configuring Minikube with GitHub Authentication
themr0c marked this conversation as resolved.
Show resolved Hide resolved

== Authentication on Kubernetes
On {kubernetes}, link:https://github.com/oauth2-proxy/oauth2-proxy[OAuth2 Proxy] is deployed as che-gateway sidecar ensuring requests authentication. Then {kubernetes} must have configured OIDC issuer to know about users identities and CheCluster CR must be configured with:
skabashnyuk marked this conversation as resolved.
Show resolved Hide resolved
```
spec:
auth:
identityProviderURL: <oidc-issuer-url>
oAuthClientName: <oauth-client-id>
oAuthSecret: <oauth-client-secret>
```

Chectl can configure minikube with link:https://dexidp.io/[Dex] as OIDC issuer with preconfigured static users. This is the default setup when deploying on Minikube with {devworkspace} engine `chectl server:deploy --platform minikube --workspace-engine=dev-workspace`. Dex can serve as a bridge to 3rd party {identity-provider}, like GitHub.
themr0c marked this conversation as resolved.
Show resolved Hide resolved

themr0c marked this conversation as resolved.
Show resolved Hide resolved
=== Setup GitHub as identity provider on Kubernetes
themr0c marked this conversation as resolved.
Show resolved Hide resolved
To setup GitHub as {prod-short} identity provider
themr0c marked this conversation as resolved.
Show resolved Hide resolved

themr0c marked this conversation as resolved.
Show resolved Hide resolved
. Create OAuth App in GitHub at https://github.com/settings/applications/new (see link:https://docs.github.com/en/developers/apps/building-oauth-apps/creating-an-oauth-app[GitHub documentation]):
themr0c marked this conversation as resolved.
Show resolved Hide resolved
+
[source]
themr0c marked this conversation as resolved.
Show resolved Hide resolved
----
Application name: Eclipse Che <1>
themr0c marked this conversation as resolved.
Show resolved Hide resolved
themr0c marked this conversation as resolved.
Show resolved Hide resolved
Homepage URL: https://<minikube_ip>.nip.io <2>
Authorization callback URL: https://dex.<minikube_ip>.nip.io/callback <3>
----
+
<1> Name is only displayed on GitHub. It is not used internally so it can be any name.
<2> Main URL to Che instance.
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
<3> Callback URL to Dex. Chectl deploys Dex on `dex.` subdomain.
sparkoo marked this conversation as resolved.
Show resolved Hide resolved
+
Note: To get Minikube IP, run `$ minikube ip` in the terminal.
themr0c marked this conversation as resolved.
Show resolved Hide resolved


. On GitHub Generate new client secret for just created OAuth application
themr0c marked this conversation as resolved.
Show resolved Hide resolved

. edit dex configmap `kubectl edit configmap dex -n dex`
themr0c marked this conversation as resolved.
Show resolved Hide resolved
```
connectors:
- type: github
id: github
name: GitHub
config:
clientID: <client_id> <1>
clientSecret: <client_secret> <2>
redirectURI: https://dex.<minikube_ip>.nip.io/callback <3>
```
+
<1> OAuth client id copied from GitHub OAuth application
<2> OAuth client secret, generated at GitHub in previous step
<3> Callback URL to Dex. This must match configuration in GitHub OAuth application from step 1.
+
See link:https://dexidp.io/docs/connectors/github/[Dex documentation] for details
themr0c marked this conversation as resolved.
Show resolved Hide resolved

Note: To remove dex static users, delete all `enablePasswordDB` and `staticPasswords` sections.
themr0c marked this conversation as resolved.
Show resolved Hide resolved

. restart Dex pod to load new configuration `kubectl delete pod dex -n dex`
themr0c marked this conversation as resolved.
Show resolved Hide resolved

. On next opening {prod-short} URL, user will be prompted with GitHub login
themr0c marked this conversation as resolved.
Show resolved Hide resolved