Skip to content

Commit 7089410

Browse files
authoredFeb 24, 2025
Update 2025-02-07-okta-hosted-sign-in-widget.md
1 parent b8d24f0 commit 7089410

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed
 

‎_source/_posts/2025-02-07-okta-hosted-sign-in-widget.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ We're not here to change the button color or simply slap a logo on the widget; w
5353
We will accomplish this by utilizing standard Javascript and CSS.
5454
If you use the Okta-hosted widget, you will find it under **Customizations** > **Brands** > **[your custom brand]** > **Pages** > **Sign-in** page. Click the **Configure** button and toggle the **Code editor** to **ON**. At this point, you should see some code appear like the one below:
5555

56-
```HTML
56+
```html
5757
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
5858
<html>
5959
<head>
@@ -115,20 +115,20 @@ If you want more fine-grained control over the widget's appearance, Okta allows
115115

116116
Within the `<head>` section and below the following code,
117117

118-
```HTML
118+
```html
119119
<!-- Favicon from theme -->
120120
<link rel="shortcut icon" href="{{faviconUrl}}" type="image/x-icon"/>
121121
```
122122

123123
insert the following code that points to the Font Awesome library, which is hosted on my AWS S3 bucket (you can use your own Font Awesome or any other library, but you would need to modify the code accordingly).
124124

125-
```CSS
125+
```css
126126
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
127127
```
128128

129129
Next, let's add some general styles to achieve the desired look. Just below the following block of code,
130130

131-
```HTML
131+
```html
132132
<title>{{pageTitle}}</title>
133133
{{{SignInWidgetResources}}}
134134

@@ -141,7 +141,7 @@ Next, let's add some general styles to achieve the desired look. Just below the
141141

142142
add the following code,
143143

144-
```CSS
144+
```css
145145
<style>
146146
/********* custom css ************/
147147
@import url('https://fonts.googleapis.com/css?family=Montserrat:400,800');
@@ -356,7 +356,7 @@ Lastly, we will modify the widget CSS to our desired style. I will not explain e
356356

357357
Still, within the `<head>` section, and just below the code above, insert the following code:
358358

359-
```CSS
359+
```css
360360
#okta-sign-in {
361361
border-radius: 10px;
362362
background:#ffffff;
@@ -506,14 +506,14 @@ Still, within the `<head>` section, and just below the code above, insert the fo
506506
## Changing the layout of the Okta Sign-In Widget
507507
We must modify the page's core HTML to make the widget layout horizontal and achieve the desired effect. Replace the default widget code:
508508

509-
```HTML
509+
```html
510510
<div id="login-bg-image-id" class="login-bg-image tb--background"></div>
511511
<div id="okta-login-container"></div>
512512
```
513513

514514
With the following code:
515515

516-
```HTML
516+
```html
517517
<!-- custom login -->
518518
<div class="container" id="container">
519519
<div class="form-container sign-up-container">
@@ -555,7 +555,7 @@ To manipulate the pieces of the widget, we need to know what those HTML elements
555555
Additionally, I've included some extra code to showcase how you can style or manipulate the widget based on the client id, making per application customizations possible.
556556

557557
Below the OktaUtil object,
558-
```HTML
558+
```html
559559
<!--
560560
"OktaUtil" defines a global OktaUtil object
561561
that contains methods used to complete the Okta login flow.
@@ -565,7 +565,7 @@ Below the OktaUtil object,
565565

566566
Add the following code:
567567

568-
```HTML
568+
```html
569569
<!-- Let's add a reference to jQuery for easy object manipulation. You do not have to do this, you can use vanila JS instead -->
570570

571571
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>

0 commit comments

Comments
 (0)