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
- Fixes#12: SSO
- Fixes#216: SSO instructions
- Fixes#215: Make sure bad password can be fixed during "add
clusters" event
REMOVE HTTPS CERT WORKAROUND BEFORE MERGE TO MASTER! MCC instance
with SSO enabled for testing currently has invalid cert chain,
so this is needed as a temporary workaround during development.
SEE '// DEBUG' COMMENTS for what still needs refactoring.
Done:
- Renamed existing `AuthProvider` to `BasicAuthProvider`. This
provider will fail with an error notification if it's used
with an MCC instance that requires SSO auth.
- Added new `SsoAuthProvider` for handling all things SSO. This
provider will fail with an error notification if it's used with
an MCC instance that does not support Keycloak SSO auth.
- Moved a few effects out of View.js and into useClusterLoder.js hook
to cut down on module size.
- Added 'SSO support' section to README with instructions on how
to configure the MCC instance's Keycloak Client to work with the
extension since it relies on `lens://` protocol handler requests.
- Added new util.js method to make console logging more helpful
and consistent, replaced all existing `console` calls with new
`logger` calls.
- `AuthClient` now supports both Basic auth and SSO auth.
- Auto-refreshing tokens under SSO works.
- Possible to activate a cluster without having to re-query for
the list of clusters that was already loaded (if any).
- Renamed ClustersProvider to ClusterDataProvider to make it
more different from ClusterActionsProvider when we use
it throughout the code (we had `clustersActions` and
`clusterActions` objects; now we have `clusterDataActions`
and `clusterActions` with less chance of a mistake).
- Fixed a bug in eventBus.ts where an exception thrown in an
event handler would cause the event bus to infinitely call
that handler in a loop.
- Added 'Refresh' feature where once clusters are loaded, the
'Sign in' button changes to 'Refresh' and clicking it uses
existing creds to reload/refresh the cluster list without
going through full auth again (if creds are still valid).
- Added ability to filter clusters to a list of specified
namespaces via the 'add clusters' extension event.
- Added instructions to Help section in README.
- Cluster selection is limited to ONE cluster when using SSO
because supporting multiple clusters would lead to a really
bad UX (browser opening multiple times, user likely missing
some of them) and spaghetti code (because it's more than just
async requests since the event loop goes idle while waiting
for the user to respond in the browser).
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@ Supports Lens `>= 4.2.1`.
8
8
9
9
- Fixed: Emotion styles generated by this extension were conflicting with Emotion styles generated by Lens ([#205](https://github.com/Mirantis/lens-extension-cc/pull/205))
10
10
- Fixed: Offline token option should default to false ([#217](https://github.com/Mirantis/lens-extension-cc/issues/217))
11
+
- Fixed: There's no way to re-enter the password during an "Add clusters to Lens" event ([#215](https://github.com/Mirantis/lens-extension-cc/issues/215))
Copy file name to clipboardExpand all lines: README.md
+29-2
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,36 @@ The `prepublishOnly` script will automatically produce a production build in the
84
84
85
85
## Help
86
86
87
-
### SSO not supported
87
+
### SSO support
88
88
89
-
Mirantis Container Cloud instances that use third-party SSO authentication (e.g. Google OAuth) are __not supported__ at this time. We plan on adding support [soon](https://github.com/Mirantis/lens-extension-cc/issues/12).
89
+
Mirantis Container Cloud instances that use third-party SSO authentication via __Keycloak__ are supported.
90
+
91
+
Since the integration leverages the `lens://` URL protocol handling feature for extensions, __Lens 4.2__ (or later) is required, and the __Keycloak Client__ of the instance must be configured as follows:
92
+
93
+
- Allow requests from the `"*"` origin. This is because the internal Electron browser used by the Lens App uses a random port. Therefore, the originating URL cannot be predicted.
94
+
- Allow the following redirect URI: `lens://extensions/@mirantis/lens-extension-cc/oauth/code`
95
+
96
+
#### Authentication flow
97
+
98
+
The extension will automatically detect when an instance uses SSO (upon clicking the __Access__ button).
99
+
100
+
If that's the case, Lens will open the instance's SSO authorization page in the system's default browser.
101
+
102
+
Once authorized, Keycloak will redirect to the `lens://...` URL, triggering the browser to ask permission to open the Lens app to process the request (unless permission was granted previously with the _always allow_ check box for your SSO ID Provider, e.g. `accounts.google.com`):
Whether the permission was already given, or upon clicking __Open Lens.app__, Lens will receive focus again, and the extension will then read the list of namespaces and clusters as it normally would when using basic (username/password) authentication.
107
+
108
+
The temporary browser window used for SSO authorization will likely still be open, and should now be closed manually.
109
+
110
+
#### Single cluster limitation
111
+
112
+
Due to technical issues with generating a unique kubeConfig per cluster, when the Container Cloud instance uses SSO authorization, cluster selection is __limited to a single cluster__:
0 commit comments