-
-
Notifications
You must be signed in to change notification settings - Fork 175
OpenAM UI JS SDK #941
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
base: master
Are you sure you want to change the base?
OpenAM UI JS SDK #941
Changes from all commits
5cce4e7
30044e5
c1bab4d
58ba2d3
c2a3ec7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| #VITE_OPENAM_SERVER=http://openam.example.org:8080 | ||
| #VITE_OPENAM_CONTEXT_PATH=/openam |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| VITE_OPENAM_SERVER=http://openam.example.org:8080 | ||
| VITE_OPENAM_CONTEXT_PATH=/openam |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| # Logs | ||
| logs | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| dist | ||
| dist-ssr | ||
| *.local | ||
|
|
||
| # Editor directories and files | ||
| .vscode/* | ||
| !.vscode/extensions.json | ||
| .idea | ||
| .DS_Store | ||
| *.suo | ||
| *.ntvs* | ||
| *.njsproj | ||
| *.sln | ||
| *.sw? | ||
|
|
||
|
|
||
| *.zip | ||
|
|
||
| example/ |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,144 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # OpenAM Alternative Frontend SDK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| OpenAM is a robust access management solution, but integrating it with modern frontend applications can be complex and time-consuming. This SDK aims to simplify that process by providing pre-built React components and a flexible, modular setup, saving developers significant time while ensuring secure, seamless integration with OpenAM. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This project is intended to provide an alternative frontend SDK for interacting with Open Identity Platform's OpenAM authentication services. It is built using modern web technologies and aims to simplify the integration process for developers. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Features | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Ease of Use**: Pre-configured React components ready for integration. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Modular & Flexible**: Easily swap components and customize the SDK to suit your needs. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **TypeScript Support**: Enhance development experience with type safety and better code completion. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Seamless Integration**: Easily integrate OpenAM with minimal configura | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - **Seamless Integration**: Easily integrate OpenAM with minimal configura | |
| - **Seamless Integration**: Easily integrate OpenAM with minimal configuration. |
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The README refers to copying dist/app, but this project’s build output is configured to go to target/app (see vite.config.ts and the Maven assembly descriptors). Update the documentation to point to the correct output path/artifact so the instructions work.
| Copy the contents of the `dist/app` folder into your OpenAM WAR file (or the extracted WAR contents in your web container), e.g., into a directory like `extui`, so it could be accessible in your OpenAM context path, for example, http://openam.example.org:8080/openam/extui | |
| Copy the contents of the `target/app` folder into your OpenAM WAR file (or the extracted WAR contents in your web container), e.g., into a directory like `extui`, so it could be accessible in your OpenAM context path, for example, http://openam.example.org:8080/openam/extui |
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: "shold" should be "should".
| You can also run the application in a standalone server. The only condition, the servers shold be on the same subdomain, so OpenAM's cookies could be sent from the frontend application. | |
| You can also run the application in a standalone server. The only condition, the servers should be on the same subdomain, so OpenAM's cookies could be sent from the frontend application. |
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The documentation example uses import OpenAMUI from 'openam-js-sdk', but the library currently exports OpenAMUI as a named export (see src/lib/index.ts). Update the README to use the correct import style so consumers can copy/paste successfully.
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The customization example uses errorForm, but the config interface property is ErrorForm (capital E) and the default config also uses ErrorForm. As written, the example won’t override the error UI. Update the README example to match the actual config API shape.
Copilot
AI
Mar 26, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration override example has multiple copy/paste issues: it uses errorForm instead of ErrorForm, and the snippet as written is not valid TSX/TS (unbalanced braces/parentheses and missing imports like createRoot, StrictMode, OpenAMUI). Please fix the snippet so it compiles and matches the actual exported API.
| //update the default configuration | |
| import { setConfig } from 'openam-js-sdk' | |
| setConfig({ | |
| openamServer: 'https://openam.example.org:443', | |
| openamContextPath: '/am', | |
| errorForm: ({ error, resetError }) => { | |
| return <div> | |
| <h1>An error occurred</h1> | |
| <p>{error?.message}</p> | |
| <input type="button" value="Retry" onClick={() => resetError()} /> | |
| </div> | |
| }) | |
| createRoot(document.getElementById('root')!).render( | |
| <StrictMode> | |
| <OpenAMUI /> | |
| </StrictMode>, | |
| ) | |
| // update the default configuration | |
| import React, { StrictMode } from 'react'; | |
| import { createRoot } from 'react-dom/client'; | |
| import { OpenAMUI, setConfig } from 'openam-js-sdk'; | |
| setConfig({ | |
| openamServer: 'https://openam.example.org:443', | |
| openamContextPath: '/am', | |
| ErrorForm: ({ error, resetError }) => { | |
| return ( | |
| <div> | |
| <h1>An error occurred</h1> | |
| <p>{error?.message}</p> | |
| <input | |
| type="button" | |
| value="Retry" | |
| onClick={() => resetError()} | |
| /> | |
| </div> | |
| ); | |
| }, | |
| }); | |
| createRoot(document.getElementById('root')!).render( | |
| <StrictMode> | |
| <OpenAMUI /> | |
| </StrictMode>, | |
| ); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| * The contents of this file are subject to the terms of the Common Development and | ||
| * Distribution License (the License). You may not use this file except in compliance with the | ||
| * License. | ||
| * | ||
| * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the | ||
| * specific language governing permission and limitations under the License. | ||
| * | ||
| * When distributing Covered Software, include this CDDL Header Notice in each file and include | ||
| * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL | ||
| * Header, with the fields enclosed by brackets [] replaced by your own identifying | ||
| * information: "Portions copyright [year] [name of copyright owner]". | ||
| * | ||
| * Copyright 2025 3A Systems LLC. | ||
| --> | ||
| <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd"> | ||
| <id>app</id> | ||
| <baseDirectory>/</baseDirectory> | ||
| <formats> | ||
| <format>zip</format> | ||
| </formats> | ||
| <fileSets> | ||
| <fileSet> | ||
| <directory>target/app</directory> | ||
| <outputDirectory>/</outputDirectory> | ||
| </fileSet> | ||
| </fileSets> | ||
| </assembly> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| * The contents of this file are subject to the terms of the Common Development and | ||
| * Distribution License (the License). You may not use this file except in compliance with the | ||
| * License. | ||
| * | ||
| * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the | ||
| * specific language governing permission and limitations under the License. | ||
| * | ||
| * When distributing Covered Software, include this CDDL Header Notice in each file and include | ||
| * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL | ||
| * Header, with the fields enclosed by brackets [] replaced by your own identifying | ||
| * information: "Portions copyright [year] [name of copyright owner]". | ||
| * | ||
| * Copyright 2025 3A Systems LLC. | ||
| --> | ||
| <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd"> | ||
| <id>lib</id> | ||
| <baseDirectory>/</baseDirectory> | ||
| <formats> | ||
| <format>zip</format> | ||
| </formats> | ||
| <fileSets> | ||
| <fileSet> | ||
| <directory>target/lib</directory> | ||
| <outputDirectory>/</outputDirectory> | ||
| </fileSet> | ||
| </fileSets> | ||
| </assembly> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import js from '@eslint/js' | ||
| import globals from 'globals' | ||
| import reactHooks from 'eslint-plugin-react-hooks' | ||
| import reactRefresh from 'eslint-plugin-react-refresh' | ||
| import tseslint from 'typescript-eslint' | ||
| import { defineConfig, globalIgnores } from 'eslint/config' | ||
|
|
||
| export default defineConfig([ | ||
| globalIgnores(['dist']), | ||
| { | ||
| files: ['**/*.{ts,tsx}'], | ||
| extends: [ | ||
| js.configs.recommended, | ||
| tseslint.configs.recommended, | ||
| reactHooks.configs['recommended-latest'], | ||
| reactRefresh.configs.vite, | ||
| ], | ||
| languageOptions: { | ||
| ecmaVersion: 2020, | ||
| globals: globals.browser, | ||
| }, | ||
| }, | ||
| ]) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>openam-js-sdk</title> | ||
| </head> | ||
| <body> | ||
| <div id="root"></div> | ||
| <script type="module" src="/src/main.tsx"></script> | ||
| </body> | ||
| </html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extuiweb resources are added with<filtering>true</filtering>. Maven filtering can modify and break built frontend assets (JS/CSS) in the final WAR. Unless you intentionally substitute Maven properties in the built output, set filtering to false forextui(and consider limiting filtering to specific text templates).