Sample app shell to leverage auth0 as authentication provider.
⚡ This sample demonstrates using piral-oidc
to connect to an available auth0 identity provider.
Feel free to play around with the code using StackBlitz.
You can visit this demo at auth0.samples.piral.cloud/.
Install the dependencies:
npm install
If you want to change the values to your auth0 provider then go ahead and modify the values in the src/client.ts module. These values need to come from auth0 as shown in the next section.
Now run:
npm start
The app shell should be up and running.
For the sample you can log in with the following sample credentials:
- Username is
foo@bar.com
- Password is
foobar
followed by123
and!
Note: Due to the auth0 configuration only port 1234
is working (only accepting http://localhost:1234 requests).
The whole configuration can be found at OIDC config.
Not much has changed there from the default options. The only things that are necessary are the client details that can be found in the application settings:
The allowed login / logout and request URLs need to be configured:
Make sure to also include URLs of your other environments if applicable.
You find more information at the the oidc plugin page.
Most issues will actually be solved by getting familiar with the library (oidc-client
) underneath. See oidc-client.
Piral and this sample code is released using the MIT license. For more information see the license file.