Bring Your Own Brand...to the Okta Chicklet Page
If you've ever considered building your own User HomePage (aka the "Chicklet Page") – in order to have 100% control of the branding – and want some sample code to get started, you've found the right repo!
This project is built in Vue.js and uses
- Vuetify 2.x Material Design Component Framework
- Vuedraggable Vue drag-and-drop component based on Sortable.js
- Okta Vue.js SDK
- Okta Sign-in Widget 3.x
This application is represented by an OpenID Connect application in Okta, so we need to configure one:
- In your Developer Console, navigate to the Applications menu, click Add Application and select Single-Page App
- Click Next, then enter an Application Name. Then:
- Set Base URIs to
http://localhost:8080/(it should already be set by default) - Leave the default setting
http://localhost:8080/implicit/callbackvalue in the list of Redirect URIs - Leave the default setting, Group assignments = Everyone
- Select Authorization Code and deselect the default Implicit checkbox
- Set Base URIs to
- Click Done to redirect back to the General tab of your application.
- Make note of the Client ID, as it will be needed environment configuration.
- Make sure that Use PKCE (for public clients) (underneath the Client Id) is selected
- Navigate to Api > Trusted Origins and add
http://localhost:8080as a type = CORS entry.
- Clone this repository and
cdinto the main directory - Run
npm install - Run
npm install @vue/cli -g - Create
src/.config.jsand edit it in with the values below:- Note the
.in front of the filename. This is simply for convention
- Note the
export default {
oidc: {
client_id: {{Your Client ID from the "Okta Org Setup" setup}},
issuer: 'https://{{Your Okta Org Url}}/oauth2/default',
redirect_uri: '/implicit/callback',
scope: 'openid profile email',
}
}
- The following command compiles and hot-reloads for development environment
npm run serve - Open your browser to
http://localhost:8080and login
npm run build
To see an example of logging in via redirect to the Okta hosted Signin page (instead of the Signin Widget), add loginRedirect to the .config.js file.
The resulting file should look like this:
export default {
oidc: {
client_id: {{Your Client ID from the "Okta Org Setup" setup}},
issuer: 'https://{{Your Okta Org Url}}/oauth2/default',
redirect_uri: '/implicit/callback',
scope: 'openid profile email',
},
loginRedirect: true
}
Sometimes it is useful to override the App icons that were uploaded into Okta with higher resolution images. To do this, edit the /src/assets/icons.js file with a list of objects containing the appId and the associated logo URL.
This sample provides sample implementation user management (profile/password update) using Lambda and Amazon API Gateway. Navigate to the api folder to see more.
