-
Notifications
You must be signed in to change notification settings - Fork 261
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
Add legacy application token section #6783
Changes from 2 commits
79bace0
f357ee5
9c4a9ac
934a4d4
79753a3
05165c3
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,6 @@ | ||
--- | ||
"@wso2is/admin.applications.v1": patch | ||
"@wso2is/i18n": patch | ||
--- | ||
|
||
Introduce UI for legacy app token section. |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -16,6 +16,8 @@ | |||||
* under the License. | ||||||
*/ | ||||||
|
||||||
import Alert from "@oxygen-ui/react/Alert"; | ||||||
import AlertTitle from "@oxygen-ui/react/AlertTitle"; | ||||||
import Box from "@oxygen-ui/react/Box"; | ||||||
import Chip from "@oxygen-ui/react/Chip"; | ||||||
import { AppState, ConfigReducerStateInterface } from "@wso2is/admin.core.v1"; | ||||||
|
@@ -215,6 +217,9 @@ | |||||
const { isOrganizationManagementEnabled } = useGlobalVariables(); | ||||||
const [ isEncryptionEnabled, setEncryptionEnable ] = useState(false); | ||||||
const [ isPublicClient, setPublicClient ] = useState<boolean>(false); | ||||||
const useClientIdAsSubClaimForAppTokens: boolean = initialValues.useClientIdAsSubClaimForAppTokens; | ||||||
const omitUsernameInIntrospectionRespForAppTokens: boolean | ||||||
= initialValues.omitUsernameInIntrospectionRespForAppTokens; | ||||||
const [ callBackUrls, setCallBackUrls ] = useState(""); | ||||||
const [ audienceUrls, setAudienceUrls ] = useState(""); | ||||||
const [ showURLError, setShowURLError ] = useState(false); | ||||||
|
@@ -290,6 +295,8 @@ | |||||
const requestObjectEncryptionMethod: MutableRefObject<HTMLElement> = useRef<HTMLElement>(); | ||||||
const subjectToken: MutableRefObject<HTMLElement> = useRef<HTMLElement>(); | ||||||
const applicationSubjectTokenExpiryInSeconds: MutableRefObject<HTMLElement> = useRef<HTMLElement>(); | ||||||
const useClientIdAsSubClaimForAppTokensEle: MutableRefObject<HTMLElement> = useRef<HTMLElement>(); | ||||||
const omitUsernameInIntrospectionRespForAppTokensEle: MutableRefObject<HTMLElement> = useRef<HTMLElement>(); | ||||||
|
||||||
const [ isSPAApplication, setSPAApplication ] = useState<boolean>(false); | ||||||
const [ isOIDCWebApplication, setOIDCWebApplication ] = useState<boolean>(false); | ||||||
|
@@ -1353,6 +1360,8 @@ | |||||
} | ||||||
inboundConfigFormValues = { | ||||||
...inboundConfigFormValues, | ||||||
omitUsernameInIntrospectionRespForAppTokens: | ||||||
values.get("omitUsernameInIntrospectionRespForAppTokens")?.length > 0, | ||||||
pushAuthorizationRequest: { | ||||||
requirePushAuthorizationRequest: values.get("requirePushAuthorizationRequest")?.length > 0 | ||||||
}, | ||||||
|
@@ -1366,7 +1375,8 @@ | |||||
subject: { | ||||||
sectorIdentifierUri: initialValues?.subject?.sectorIdentifierUri, | ||||||
subjectType: initialValues?.subject?.subjectType | ||||||
} | ||||||
}, | ||||||
useClientIdAsSubClaimForAppTokens: values.get("useClientIdAsSubClaimForAppTokens")?.length > 0 | ||||||
}; | ||||||
|
||||||
// If the app is not a newly created, add `clientId` & `clientSecret`. | ||||||
|
@@ -2566,6 +2576,130 @@ | |||||
</> | ||||||
) } | ||||||
|
||||||
{ /* Legacy Application Tokens */ } | ||||||
{ | ||||||
(!omitUsernameInIntrospectionRespForAppTokens | ||||||
|| !useClientIdAsSubClaimForAppTokens) | ||||||
&& ( | ||||||
<Grid.Row columns={ 2 }> | ||||||
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }> | ||||||
<Divider /> | ||||||
<Divider hidden /> | ||||||
</Grid.Column> | ||||||
<Grid.Column mobile={ 16 } tablet={ 16 } computer={ 16 }> | ||||||
<Heading as="h4"> | ||||||
{ t("applications:forms.inboundOIDC.sections" + | ||||||
".legacyApplicationTokens.heading") } | ||||||
</Heading> | ||||||
<Divider hidden /> | ||||||
{ | ||||||
( | ||||||
<Alert severity="warning"> | ||||||
<AlertTitle | ||||||
className="alert-title"> | ||||||
<Trans components={ { strong: <strong/> } } >Note:</Trans> | ||||||
</AlertTitle> | ||||||
<Trans | ||||||
i18nKey={ t("actions:fields.authentication.info.message") } | ||||||
> | ||||||
You currently using an outdated behavior for application tokens. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||||||
Please follow the below guideline before migrating to the new behavior. | ||||||
<ol> | ||||||
<li> | ||||||
<strong>Client Application Changes:</strong> | ||||||
<p>Update your client application to no longer use the | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
<code>sub</code> claim to refer to the application | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||
owner's user ID in the application token.</p> | ||||||
</li> | ||||||
<li> | ||||||
<strong>Introspection Response Updates:</strong> | ||||||
<p>Modify your application to stop relying on the | ||||||
<code>username</code> claim in the introspection endpoint | ||||||
response for application tokens, as this claim will no | ||||||
longer be included.</p> | ||||||
</li> | ||||||
</ol> | ||||||
</Trans> | ||||||
</Alert> | ||||||
) | ||||||
} | ||||||
{ | ||||||
!useClientIdAsSubClaimForAppTokens && ( | ||||||
<> | ||||||
<Field | ||||||
ref={ useClientIdAsSubClaimForAppTokensEle } | ||||||
name="useClientIdAsSubClaimForAppTokens" | ||||||
required={ false } | ||||||
type="checkbox" | ||||||
disabled={ false } | ||||||
value={ | ||||||
initialValues?.useClientIdAsSubClaimForAppTokens ? | ||||||
[ "useClientIdAsSubClaimForAppTokens" ] | ||||||
: [] } | ||||||
readOnly={ readOnly } | ||||||
data-componentId={ | ||||||
`${ componentId }-use-client-id-as-sub-claim-for-app-tokens` } | ||||||
children={ [ | ||||||
{ | ||||||
label: t("applications:forms.inboundOIDC.sections." | ||||||
+ "legacyApplicationTokens.fields" | ||||||
+ ".useClientIdAsSubClaimForAppTokens.label"), | ||||||
value: "useClientIdAsSubClaimForAppTokens" | ||||||
} | ||||||
] } | ||||||
/> | ||||||
<Hint> | ||||||
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens." | ||||||
+ "fields.useClientIdAsSubClaimForAppTokens.hint") } | ||||||
</Hint> | ||||||
</> | ||||||
) | ||||||
} | ||||||
{ | ||||||
(!omitUsernameInIntrospectionRespForAppTokens | ||||||
&& !useClientIdAsSubClaimForAppTokens) && | ||||||
( | ||||||
<Divider hidden /> | ||||||
) | ||||||
} | ||||||
{ | ||||||
(!omitUsernameInIntrospectionRespForAppTokens) && | ||||||
( | ||||||
<> | ||||||
<Field | ||||||
ref={ omitUsernameInIntrospectionRespForAppTokensEle } | ||||||
name="omitUsernameInIntrospectionRespForAppTokens" | ||||||
required={ false } | ||||||
type="checkbox" | ||||||
disabled={ false } | ||||||
value={ | ||||||
initialValues?.omitUsernameInIntrospectionRespForAppTokens ? | ||||||
[ "omitUsernameInIntrospectionRespForAppTokens" ] | ||||||
: [] } | ||||||
readOnly={ readOnly } | ||||||
data-componentId={ | ||||||
`${ componentId }-omit-username-in-introspection-resp-for-app-tokens` } | ||||||
children={ [ | ||||||
{ | ||||||
label: t("applications:forms.inboundOIDC.sections" | ||||||
+ ".legacyApplicationTokens.fields." | ||||||
+ "omitUsernameInIntrospectionRespForAppTokens.label"), | ||||||
value: "omitUsernameInIntrospectionRespForAppTokens" | ||||||
} | ||||||
] } | ||||||
/> | ||||||
<Hint> | ||||||
{ t("applications:forms.inboundOIDC.sections.legacyApplicationTokens." | ||||||
+ "fields.omitUsernameInIntrospectionRespForAppTokens.hint") } | ||||||
</Hint> | ||||||
</> | ||||||
) | ||||||
} | ||||||
</Grid.Column> | ||||||
</Grid.Row> | ||||||
) | ||||||
} | ||||||
|
||||||
{ /* Access Token */ } | ||||||
{ | ||||||
!isSystemApplication | ||||||
|
@@ -4377,6 +4511,7 @@ | |||||
}, | ||||||
idToken: undefined, | ||||||
logout: undefined, | ||||||
omitUsernameInIntrospectionRespForAppTokens: undefined, | ||||||
pkce: { | ||||||
mandatory: false, | ||||||
supportPlainTransformAlgorithm: false | ||||||
|
@@ -4386,6 +4521,7 @@ | |||||
scopeValidators: [], | ||||||
state: undefined, | ||||||
subjectToken: undefined, | ||||||
useClientIdAsSubClaimForAppTokens: undefined, | ||||||
validateRequestObjectSignature: undefined | ||||||
} | ||||||
}; |
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.