Skip to content
Closed
Changes from 1 commit
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -661,12 +661,12 @@ The Sign-In Widget for embedded authentication is app aware. This means that you

When the page renders, an object called `OktaUtil` exists on the page. By calling the `OktaUtil.getRequestContext()` method, scripts on the page can get details about the current request.

To access the app's client ID (which uniquely identifies the app), write a function to safely get the client ID from the request context:
To access the application's ID (which uniquely identifies the app), write a function to safely get the app ID from the request context:
Comment thread
askouras marked this conversation as resolved.
Outdated

```html
// Identity Engine
<script>
function getClientId() {
function getAppId() {
if (!OktaUtil) return undefined;

var requestContext = OktaUtil.getRequestContext();
Expand All @@ -678,35 +678,43 @@ To access the app's client ID (which uniquely identifies the app), write a funct

// Classic
<script>
function getClientId() {
function getAppId() {
if (!OktaUtil) return undefined;

var requestContext = OktaUtil.getRequestContext();

// OIDC Apps
if (requestContext && requestContext.target && requestContext.target.clientId) {
return requestContext.target.clientId;
}

// SAML Apps
if (requestContext && requestContext.authentication && requestContext.authentication.issuer.id){
return requestContext.authentication.issuer.id;
}
}
</script>
```
Please note that in Classic Engine orgs, it is not possible to retrieve the application ID for SWA or Bookmark apps from the requestContext.
Comment thread
askouras marked this conversation as resolved.
Outdated

Using this method, you can inspect the client ID and update it. For example, if you have a CSS file on your server that's for a particular client's CSS:
Using this method, you can inspect the app ID and modify the widget configuration or appearance when user's log into the target application. For example, if you have a CSS file on your server that's for a particular OpenID Connect client's CSS:
Comment thread
askouras marked this conversation as resolved.
Outdated

1. In the Admin Console, go to **Applications** > **Applications**.
2. Select the app integration that you need the client ID for.
3. On the **General** tab, copy the ID from the **Client ID** box in the **Client Credentials** section.

```html
<script>
var clientId = getClientId();
var appId = getAppId();

if (clientId === '00exampleclientid'){
if (appId === '00exampleclientid'){
// add application-specific CSS
var head = document.head;
var link = document.createElement('link');

link.type = 'text/css';
link.rel = 'stylesheet';
link.href = 'https://example.com/styles/' + clientId + '.css';
link.href = 'https://example.com/styles/' + appId + '.css';
head.appendChild(link);
}
</script>
Expand Down