14.177.1 • Published 2 days ago

@genesislcap/foundation-login v14.177.1

Weekly downloads
-
License
SEE LICENSE IN li...
Repository
github
Last release
2 days ago

Foundation Login

API

Introduction

This micro front-end includes a set of identity management functions: authentication (including via SSO) and password reset, for example. Many of the features can be turned on and off as desired, and parts of the login screen (such as the logo) can be customised.

An example of the main login screen: Main login screen example

An example of authentication via SSO: Main login screen example

An example of the change password screen: Main login screen example

Login set-up

:::info If you build a project upon one of the Genesis seed apps, then the Login micro front-end will already be set-up for you. :::

To enable this micro front-end in your application, follow the steps below.

  • Add @genesislcap/foundation-login as a dependency in your package.json file. Whenever you change the dependencies of your project, always you run the $ npm run bootstrap command again. You can see more information on the package.json basics page.
{
  ...
  "dependencies": {
    "@genesislcap/foundation-login": "latest"
  },
  ...
}

:::note This page assumes you're using the Routing systems that are part of foundation-ui, and will cover set-up as part of that routing system. :::

  • In the router configuration for your application, import the Login class and the Settings type. As shown in this example, you might want to import Settings with an alias to avoid name clashes.
import { Login, Settings as LoginSettings } from '@genesislcap/foundation-login';
  • Next you'll want to ensure that your router config uses your LoginSettings as its generic type so you can configure the login route.
export class MainRouterConfig extends RouterConfiguration<LoginSettings> {
	...
}
  • Then add the required config to the router config that you use. For example, you'll want to set up the Login class to be used on the /login route, and pass in its required settings. See customising login.
{ path: '', redirect: 'login' },
{
	path: 'login',
	element: Login,
	title: 'Login',
	name: 'login',
	layout: loginLayout,
	// Login settings that are defined in the LoginSettings type
	settings: {
		defaultRedirectUrl: 'protected',
		public: true,
		resetPassword: true,
		ssoToggle: true,
		ssoEnable: false,
	},
	childRouters: true,
},
  • You'll also want to set up things like the NavigationContributor in this class.

:::noteExample An example of this and other required settings for the router configuration with regard to the login system can be found in the example in the API reference. :::

  • The functionality of the Login class is configured via the settings block on its route, but the other routes will also have customisation on them too. The main options to set here are:

  • allowAutoAuth which will log the user back in onto the page when they navigate away if they already have an authenticated session

  • public which will indicate that a route doesn't require the user to be authenticated to view
{
	path: 'admin',
	element: Admin,
	title: 'Admin',
	name: 'admin',
	settings: { allowAutoAuth: true },
},
{
	path: 'info',
	element: Info,
	title: 'Info',
	name: 'info',
	settings: { public: true },
},

:::warningWarning By default, a route that isn't marked public is not. However, a non-public route isn't going to block non-authenticated users automatically from viewing them. This must be impelmented in the NavigationContributor, as shown in the previously mentioned example. :::

Authentication

For authentication, most configuration is set in the back end. You should familiarise yourself with the authentication section of the back-end.

Username & password

The standard authentication method is the user supplying their username and password. Even when SSO is enabled as an authentication method, the user will still have the option to sign in with their normal credentials.

:::noteTip Setting the DEFAULT_USER and DEFAULT_PASSWORD environment variables will automatically populate the credentials in the login form, which can be useful during development so developers don't need to write out their credentials continuously. :::

SSO

SSO functionality allows the Login micro front-end to work with your company's existing authentication system, enabling them to have a single set of credentials - incluidng those built on the Genesis low-code platform. Genesis supports SSO with both JWT and SAML.

Setting up SSO is primarily a back-end task; however, there is a small amount of configuration covered in the customisation part of this documentation.

:::noteInfo The standard process of SSO is that the SSO authentication provider flow is opened via a redirect in the current page. However, many authentication providers block their system when running in an iframe to prevent clickjacking attacks. Because of this, if the Login micro front-end detects that it is running in an iframe, it opens up the authentication provider in a popup instead. :::

Customising login

The Login micro front-end uses a parameterless constructor. Therefore, the configuration needs to be set via the settings javascript object in the router, as shown in the set-up step. See the full settings API here.

Enabled functionality

In the introduction section, the reset password functionality is shown. However, this flow must be enabled with the resetPassword option.

Logo

You will probably want to use your company's logo instead of the Genesis logo. A custom logo can be configured with the logoSrc, logoWidth, logoHeight settings. If you don't want to use a logo, you can instead hide the logo with hideLogo.

Enable SSO

As mentioned in the authentication section, SSO must be configured on the server, but some front-end configuration is required too.

  • Setting ssoToggle is required to enable the SSO authentication as an option for the user; the user can then enable that flow with a checkbox that controls ssoEnable.
  • Enabling ssoEnable at the route-level sets the SSO flow to be the default.

  • Finally, set defaultRedirectUrl, which controls where the Login micro front-end will take the user back to once they complete the SSO journey. For example, setting option to /home will take the user to the /home path if they successfully login via SSO.

License

Note: this project provides front end dependencies and uses licensed components listed in the next section, thus licenses for those components are required during development. Contact Genesis Global for more details.

14.177.1

2 days ago

14.177.0

4 days ago

14.174.0

5 days ago

14.175.0

5 days ago

14.176.0

5 days ago

14.173.4

9 days ago

14.173.3

12 days ago

14.173.2

16 days ago

14.173.1

17 days ago

14.173.0

17 days ago

14.172.3

18 days ago

14.172.2

23 days ago

14.172.1

23 days ago

14.172.0

26 days ago

14.171.0

27 days ago

14.168.0

1 month ago

14.169.0

1 month ago

14.170.0

1 month ago

14.167.2

1 month ago

14.167.1

1 month ago

14.167.0

1 month ago

14.166.0

1 month ago

14.165.0

1 month ago

14.165.2

1 month ago

14.165.1

1 month ago

14.164.1

1 month ago

14.164.0

1 month ago

14.163.0

2 months ago

14.162.6

2 months ago

14.162.5

2 months ago

14.162.4

2 months ago

14.162.3

2 months ago

14.162.2

2 months ago

14.162.1

2 months ago

14.162.0

2 months ago

14.161.0

2 months ago

14.158.2

2 months ago

14.159.0

2 months ago

14.160.1

2 months ago

14.160.0

2 months ago

14.158.1

2 months ago

14.157.0

2 months ago

14.158.0

2 months ago

14.156.2

2 months ago

14.156.0

2 months ago

14.156.1

2 months ago

14.155.1

2 months ago

14.155.0

2 months ago

14.154.1

3 months ago

14.154.2

3 months ago

14.152.2

3 months ago

14.153.0

3 months ago

14.154.0

3 months ago

14.152.1

3 months ago

14.150.1

3 months ago

14.150.2

3 months ago

14.151.0

3 months ago

14.151.1

3 months ago

14.152.0

3 months ago

14.150.0

3 months ago

14.149.0

3 months ago

14.148.0

3 months ago

14.147.0

3 months ago

14.146.1

3 months ago

14.146.0

3 months ago

14.145.3

3 months ago

14.145.4

3 months ago

14.145.0

3 months ago

14.145.1

3 months ago

14.145.2

3 months ago

14.144.1

3 months ago

14.143.1

3 months ago

14.143.2

3 months ago

14.143.0

3 months ago

14.144.0

3 months ago

14.140.0

4 months ago

14.141.3

4 months ago

14.141.0

4 months ago

14.141.1

4 months ago

14.141.2

4 months ago

14.142.0

4 months ago

14.139.2

4 months ago

14.138.0

4 months ago

14.138.1

4 months ago

14.139.0

4 months ago

14.139.1

4 months ago

14.137.0

4 months ago

14.137.1

4 months ago

14.135.0

4 months ago

14.136.0

4 months ago

14.134.0

4 months ago

14.133.0

4 months ago

14.133.1

4 months ago

14.131.0

4 months ago

14.132.0

4 months ago

14.130.0

4 months ago

14.128.0

4 months ago

14.129.0

4 months ago

14.127.6

4 months ago

14.127.5

4 months ago

14.127.4

4 months ago

14.127.3

5 months ago

14.127.2

5 months ago

14.127.0

5 months ago

14.127.1

5 months ago

14.126.0-PA-1036.1

5 months ago

14.125.1

5 months ago

14.126.0

5 months ago

14.123.0

5 months ago

14.124.0

5 months ago

14.125.0

5 months ago

14.122.1

5 months ago

14.122.0

5 months ago

14.121.1

5 months ago

14.121.0

5 months ago

14.120.2

5 months ago

14.120.1

5 months ago

14.120.0

5 months ago

14.118.1

5 months ago

14.118.0

5 months ago

14.119.0

5 months ago

14.117.0

5 months ago

14.116.1

5 months ago

14.58.0

10 months ago

14.92.1-pa-913.3

7 months ago

14.92.1-pa-913.2

7 months ago

14.69.1

9 months ago

14.69.0

9 months ago

14.69.3

9 months ago

14.69.2

9 months ago

14.69.5

9 months ago

14.69.4

9 months ago

14.108.0

6 months ago

14.99.0-auth-mf.22

6 months ago

14.57.1

10 months ago

14.83.2-canary.1

8 months ago

14.57.0

10 months ago

14.68.2

9 months ago

14.68.1

9 months ago

14.109.0

6 months ago

14.68.0

9 months ago

14.90.0

7 months ago

14.59.0

10 months ago

14.78.0-mfa-auth.1

8 months ago

14.78.0-mfa-auth.8

8 months ago

14.78.0-mfa-auth.2

8 months ago

14.70.4-es2021.1

8 months ago

14.77.0

8 months ago

14.54.0

10 months ago

14.77.1

8 months ago

14.77.2

8 months ago

14.65.1

10 months ago

14.88.0

7 months ago

14.65.0

10 months ago

14.65.2

10 months ago

14.99.0

6 months ago

14.98.0-fui-1562.1

6 months ago

14.53.0

10 months ago

14.94.0-pa-957.1

7 months ago

14.76.0

8 months ago

14.64.0

10 months ago

14.87.0

7 months ago

14.64.2

10 months ago

14.64.1

10 months ago

14.64.3

10 months ago

14.79.1

8 months ago

14.110.0

6 months ago

14.79.0

8 months ago

14.56.0

10 months ago

14.67.3

9 months ago

14.67.2

9 months ago

14.67.5

9 months ago

14.67.4

9 months ago

14.67.1

9 months ago

14.67.0

9 months ago

14.78.2

8 months ago

14.78.3

8 months ago

14.111.0

6 months ago

14.55.0

10 months ago

14.78.0

8 months ago

14.78.1

8 months ago

14.66.0

10 months ago

14.89.0

7 months ago

14.96.1

6 months ago

14.96.0

6 months ago

14.112.0

6 months ago

14.50.1

11 months ago

14.73.0

8 months ago

14.50.0

11 months ago

14.50.3

10 months ago

14.50.2

11 months ago

14.50.5

10 months ago

14.50.4

10 months ago

14.50.6

10 months ago

14.100.0

6 months ago

14.100.1

6 months ago

14.61.1

10 months ago

14.84.0

7 months ago

14.61.0

10 months ago

14.84.1

7 months ago

14.61.2

10 months ago

14.95.0

6 months ago

14.113.1

6 months ago

14.113.0

6 months ago

14.71.1-auth-mf.2

8 months ago

14.71.1-auth-mf.4

8 months ago

14.71.1-auth-mf.3

8 months ago

14.72.0

8 months ago

14.71.1-auth-mf.6

8 months ago

14.71.1-auth-mf.9

8 months ago

14.101.1

6 months ago

14.101.2

6 months ago

14.101.0

6 months ago

14.101.3

6 months ago

14.60.0

10 months ago

14.101.4

6 months ago

14.83.0

8 months ago

14.83.1

8 months ago

14.83.2

8 months ago

14.83.3

7 months ago

14.83.4

7 months ago

14.83.5

7 months ago

14.83.6

7 months ago

14.83.7

7 months ago

14.98.0

6 months ago

14.92.0-pa-913.1

7 months ago

14.114.0

6 months ago

14.114.2

5 months ago

14.114.1

6 months ago

14.52.1

10 months ago

14.75.0

8 months ago

14.52.0

10 months ago

14.52.2

10 months ago

14.102.0

6 months ago

14.94.1-pa-958.1

6 months ago

14.63.1

10 months ago

14.86.0

7 months ago

14.63.0

10 months ago

14.97.0

6 months ago

14.115.1

5 months ago

14.115.0

5 months ago

14.51.0

10 months ago

14.74.0

8 months ago

14.103.0

6 months ago

14.62.0

10 months ago

14.85.0

7 months ago

14.62.1

10 months ago

14.92.5

7 months ago

14.49.0-bny.2

10 months ago

14.92.4

7 months ago

14.92.3

7 months ago

14.92.2

7 months ago

14.49.0-bny.1

10 months ago

14.92.1

7 months ago

14.92.0

7 months ago

14.116.0

5 months ago

14.80.0

8 months ago

14.104.0

6 months ago

14.91.3

7 months ago

14.91.2

7 months ago

14.91.1

7 months ago

14.91.0

7 months ago

14.71.1-auth-mf.20

7 months ago

14.71.1-auth-mf.21

7 months ago

14.70.4-test.1

8 months ago

14.71.1-auth-mf.11

7 months ago

14.71.1-auth-mf.10

7 months ago

14.71.1-auth-mf.13

7 months ago

14.105.0

6 months ago

14.71.1-auth-mf.12

7 months ago

14.71.1-auth-mf.15

7 months ago

14.71.1-auth-mf.14

7 months ago

14.71.1-auth-mf.17

7 months ago

14.71.1-auth-mf.16

7 months ago

14.71.1-auth-mf.19

7 months ago

14.71.1-auth-mf.18

7 months ago

14.94.2

6 months ago

14.94.1

7 months ago

14.94.0

7 months ago

14.71.0

8 months ago

14.71.1

8 months ago

14.71.2

8 months ago

14.94.0-pa-899.1

6 months ago

14.106.0

6 months ago

14.106.1

6 months ago

14.82.0

8 months ago

14.93.0

7 months ago

14.70.0

9 months ago

14.70.1

9 months ago

14.70.2

9 months ago

14.70.3

9 months ago

14.70.4

8 months ago

14.70.5

8 months ago

14.70.6

8 months ago

14.70.7

8 months ago

14.70.8

8 months ago

14.107.1

6 months ago

14.107.0

6 months ago

14.81.0

8 months ago

14.46.0

11 months ago

14.45.0

11 months ago

14.48.0

11 months ago

14.47.0

11 months ago

14.41.2-bny.5

11 months ago

14.41.2-bny.4

11 months ago

14.49.1

11 months ago

14.49.0

11 months ago

14.44.0

11 months ago

14.35.0

11 months ago

14.34.0

11 months ago

14.30.2-bny.9

11 months ago

14.30.2-bny.8

11 months ago

14.30.2-bny.7

11 months ago

14.37.0

11 months ago

14.30.2-bny.6

11 months ago

14.30.2-bny.5

11 months ago

14.30.2-bny.4

11 months ago

14.30.2-bny.3

11 months ago

14.30.2-bny.2

11 months ago

14.30.2-bny.1

11 months ago

14.40.1

11 months ago

14.40.0

11 months ago

14.36.0

11 months ago

14.41.2-bny.1

11 months ago

14.30.1-bny.1

11 months ago

14.41.2-bny.3

11 months ago

14.41.2-bny.2

11 months ago

14.39.0

11 months ago

14.31.0

11 months ago

14.42.0

11 months ago

14.42.1

11 months ago

14.38.0

11 months ago

14.30.0

11 months ago

14.30.1

11 months ago

14.30.2

11 months ago

14.30.3

11 months ago

14.25.0-bny.4

11 months ago

14.25.0-bny.3

11 months ago

14.41.0

11 months ago

14.41.1

11 months ago

14.41.2

11 months ago

14.33.1

11 months ago

14.33.2

11 months ago

14.33.0

11 months ago

14.29.2

11 months ago

14.29.1

11 months ago

14.32.0

11 months ago

14.32.1

11 months ago

14.43.0

11 months ago

14.43.1

11 months ago

14.25.0-bny.2

11 months ago

14.12.5

1 year ago

14.16.0

1 year ago

14.12.4

1 year ago

14.12.3

1 year ago

14.12.2

1 year ago

14.12.6

1 year ago

14.12.1

1 year ago

14.12.0

1 year ago

14.9.0

1 year ago

14.27.0

11 months ago

14.27.1

11 months ago

14.23.0

12 months ago

14.15.2

1 year ago

14.15.1

1 year ago

14.15.0

1 year ago

14.11.3

1 year ago

14.19.0

12 months ago

14.11.2

1 year ago

14.11.1

1 year ago

14.11.0

1 year ago

14.26.1

12 months ago

14.26.2

12 months ago

14.26.0

12 months ago

14.26.5

12 months ago

14.26.6

12 months ago

14.25.0-bny.1

12 months ago

14.26.3

12 months ago

14.26.4

12 months ago

14.26.7

12 months ago

14.22.1

12 months ago

14.22.0

12 months ago

14.14.0

1 year ago

14.18.0

12 months ago

14.24.3-bny.21

12 months ago

14.10.0

1 year ago

14.25.0

12 months ago

14.29.0

11 months ago

14.11.0-bny.15

1 year ago

14.11.0-bny.17

1 year ago

14.11.0-bny.16

1 year ago

14.21.0

12 months ago

14.20.0-bny.19

12 months ago

14.17.0

12 months ago

14.15.1-bny.18

1 year ago

14.8.0-bny.14

1 year ago

14.8.0-bny.13

1 year ago

14.8.0-bny.12

1 year ago

14.24.4-bny.22

12 months ago

14.20.0-bny.20

12 months ago

14.24.4-bny.25

12 months ago

14.24.4-bny.24

12 months ago

14.24.4-bny.23

12 months ago

14.13.0

1 year ago

14.26.5-canary.1

12 months ago

14.24.3

12 months ago

14.28.0

11 months ago

14.24.4

12 months ago

14.24.1

12 months ago

14.24.2

12 months ago

14.20.0

12 months ago

14.24.0

12 months ago

14.20.1

12 months ago

13.7.0

1 year ago

13.5.0

1 year ago

13.3.0

1 year ago

14.1.0

1 year ago

13.1.0

1 year ago

14.3.0

1 year ago

14.5.0

1 year ago

14.7.0

1 year ago

12.0.0

1 year ago

12.0.1

1 year ago

12.0.2

1 year ago

11.4.2

1 year ago

11.4.3

1 year ago

11.4.0

1 year ago

11.4.1

1 year ago

14.7.0-bny.10

1 year ago

11.4.0-bny.6

1 year ago

11.4.0-bny.7

1 year ago

13.8.0

1 year ago

13.6.0

1 year ago

13.4.0

1 year ago

13.2.0-pa-659.2

1 year ago

13.4.1

1 year ago

13.2.0-pa-659.1

1 year ago

13.2.0

1 year ago

14.0.0

1 year ago

14.0.1

1 year ago

13.0.0

1 year ago

14.2.0

1 year ago

13.0.1

1 year ago

14.4.0

1 year ago

14.6.0

1 year ago

14.6.1

1 year ago

14.8.0

1 year ago

14.8.0-bny.11

1 year ago

11.3.1

1 year ago

11.4.3-bny.8

1 year ago

11.4.3-bny.7

1 year ago

11.3.0

1 year ago

11.4.3-bny.9

1 year ago

10.3.1

1 year ago

10.3.0

1 year ago