-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Petya Koleva
committed
Dec 27, 2024
1 parent
b8cfa6b
commit 26b80de
Showing
7 changed files
with
253 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,47 @@ | ||
# MIRACL Trust DotNet Framework 4.8 OIDC Integration Sample | ||
|
||
This is an example integration with the standard dotnet framework library using Owin and OpenID Connect dependencies: | ||
- [https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin/](https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin/) | ||
 | ||
|
||
|
||
This is an example of an [OIDC integration](https://miracl.com/resources/docs/guides/authentication/oidc/) | ||
with the [MIRACL Trust platform](https://miracl.com) using standard dotnet framework library. | ||
|
||
# Dependencies | ||
|
||
This sample uses Owin and OpenID Connect dependencies to integrate with the MIRACL Trust platform: | ||
- [https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin](https://www.nuget.org/packages/Microsoft.AspNet.Identity.Owin/) | ||
- [https://www.nuget.org/packages/Microsoft.Owin.Host.SystemWeb](https://www.nuget.org/packages/Microsoft.Owin.Host.SystemWeb) | ||
- [https://www.nuget.org/packages/OpenAthens.Owin.Security.OpenIdConnect/](https://www.nuget.org/packages/OpenAthens.Owin.Security.OpenIdConnect/) | ||
- [https://www.nuget.org/packages/OpenAthens.Owin.Security.OpenIdConnect](https://www.nuget.org/packages/OpenAthens.Owin.Security.OpenIdConnect/) | ||
|
||
## Usage | ||
# Setup | ||
|
||
You can run any sample as Docker container | ||
The sample can be run directly with dotnet or with a Docker container. If you choose | ||
the latter, follow the instructions [here](../../README.md). | ||
|
||
To start an OIDC integration, you must create an OIDC application in the | ||
[MIRACL Trust Portal](https://trust.miracl.com) as described [here](https://miracl.com/resources/docs/get-started/low-code/). | ||
The `Redirect URL` must be the same as the one the sample is run with. If you use the | ||
sample's default value, it must be set to `http://localhost:59504/login`. | ||
You must pass the app's credentials to the sample through its `web.config` file | ||
as follows: | ||
|
||
``` bash | ||
<appSettings> | ||
..... | ||
<add key="REDIRECT_URL" value="http://localhost:59504/login" /> | ||
<add key="CLIENT_ID" value="CLIENT_ID" /> | ||
<add key="CLIENT_SECRET" value="CLIENT_SECRET" /> | ||
</appSettings> | ||
``` | ||
cd samples/<variant> | ||
docker build -t sample . | ||
docker run -p 8000:8000 -e CLIENT_ID=<client-id> -e CLIENT_SECRET=<client-secret> sample | ||
``` | ||
|
||
# Usage | ||
|
||
To run the sample, do the following: | ||
|
||
* open the OidcSample.sln in your Visual Studio | ||
* right click over the solution in the Solution Explorer and press | ||
`Restore NuGet Packages` | ||
* run the sample using `F5` or the run button of the redactor. | ||
|
||
This runs a sample HTTP server which navigates you to the MIRACL Trust authorization | ||
page to start the registration and authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,41 @@ | ||
# MIRACL Trust DotNet 6.0 OIDC Integration Sample | ||
|
||
This example integrates the | ||
[.NET authentication library](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.OpenIdConnect/) | ||
with the MIRACL Trust platform. | ||
 | ||
|
||
This is an example of an [OIDC integration](https://miracl.com/resources/docs/guides/authentication/oidc/) | ||
with the [MIRACL Trust platform](https://miracl.com) using DotNet6.0. | ||
|
||
# Dependencies | ||
|
||
This sample uses [.NET authentication](https://www.nuget.org/packages/Microsoft.AspNetCore.Authentication.OpenIdConnect/) | ||
library to integrate with the MIRACL Trust platform. | ||
|
||
# Setup | ||
|
||
The sample can be run directly with dotnet6 or with a Docker container. If you choose | ||
the latter, follow the instructions [here](../../README.md). | ||
|
||
To start an OIDC integration, you must create an OIDC application in the | ||
[MIRACL Trust Portal](https://trust.miracl.com) as described [here](https://miracl.com/resources/docs/get-started/low-code/). | ||
The `Redirect URL` must be the same as the one the sample is run with. If you use the | ||
sample's default value, it must be set to `http://localhost:8000/login`. | ||
You must pass the app's credentials to the sample through environment | ||
variables as follows: | ||
|
||
``` bash | ||
export CLIENT_ID=<client-id> | ||
export CLIENT_SECRET=<client-secret> | ||
``` | ||
|
||
# Usage | ||
|
||
To run the sample, do the following: | ||
|
||
```bash | ||
cd samples/dotnet6 | ||
dotnet run | ||
``` | ||
|
||
This runs a sample HTTP server and when you open http://localhost:8000/, | ||
it navigates you to the MIRACL Trust authorization page to start the | ||
registration and authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,41 @@ | ||
# MIRACL Trust Go OIDC Integration Sample | ||
|
||
This example integrates the [go-oidc library](https://github.com/coreos/go-oidc) | ||
with the MIRACL Trust platform. | ||
 | ||
|
||
This is an example of an [OIDC integration](https://miracl.com/resources/docs/guides/authentication/oidc/) | ||
with the [MIRACL Trust platform](https://miracl.com) using Golang. | ||
|
||
# Dependencies | ||
|
||
This sample uses [go-oidc](https://github.com/coreos/go-oidc) library | ||
to integrate with the MIRACL Trust platform. | ||
|
||
# Setup | ||
|
||
The sample can be run directly with Go or with a Docker container. If you choose | ||
the latter, follow the instructions [here](../../README.md). | ||
|
||
To start an OIDC integration, you must create an OIDC application in the | ||
[MIRACL Trust Portal](https://trust.miracl.com) as described [here](https://miracl.com/resources/docs/get-started/low-code/). | ||
The `Redirect URL` must be the same as the one the sample is run with. If you use the | ||
sample's default value, it must be set to `http://localhost:8000/login`. | ||
You must pass the app's credentials to the sample through environment | ||
variables as follows: | ||
|
||
``` bash | ||
export CLIENT_ID=<client-id> | ||
export CLIENT_SECRET=<client-secret> | ||
``` | ||
|
||
# Usage | ||
|
||
To run the sample, do the following: | ||
|
||
```bash | ||
cd samples/go | ||
go run . -client-id="$CLIENT_ID" -client-secret="$CLIENT_SECRET" | ||
``` | ||
|
||
This runs a sample HTTP server and when you open http://localhost:8000/, | ||
it navigates you to the MIRACL Trust authorization page to start the | ||
registration and authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
# MIRACL Trust Node.js OIDC Integration Sample | ||
|
||
This example integrates the | ||
[openid-client](https://www.npmjs.com/package/openid-client) library with the | ||
MIRACL Trust platform. | ||
 | ||
|
||
This is an example of an [OIDC integration](https://miracl.com/resources/docs/guides/authentication/oidc/) | ||
with the [MIRACL Trust platform](https://miracl.com) using Node.js. | ||
|
||
# Dependencies | ||
|
||
This sample uses [openid-client](https://www.npmjs.com/package/openid-client) library | ||
to integrate with the MIRACL Trust platform. | ||
|
||
# Setup | ||
|
||
The sample can be run directly with Node.js or with a Docker container. If you choose | ||
the latter, follow the instructions [here](../../README.md). | ||
|
||
To start an OIDC integration, you must create an OIDC application in the | ||
[MIRACL Trust Portal](https://trust.miracl.com) as described [here](https://miracl.com/resources/docs/get-started/low-code/). | ||
The `Redirect URL` must be the same as the one the sample is run with. If you use the | ||
sample's default value, it must be set to `http://localhost:8000/login`. | ||
You must pass the app's credentials to the sample through environment | ||
variables as follows: | ||
|
||
``` bash | ||
export CLIENT_ID=<client-id> | ||
export CLIENT_SECRET=<client-secret> | ||
``` | ||
|
||
# Usage | ||
|
||
To run the sample, do the following: | ||
|
||
```bash | ||
cd samples/nodejs | ||
npm install | ||
node index.js | ||
``` | ||
|
||
This runs a sample HTTP server and when you open http://localhost:8000/, | ||
it navigates you to the MIRACL Trust authorization page to start the | ||
registration and authentication. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,46 @@ | ||
# MIRACL Trust Python OIDC Integration Sample | ||
|
||
This example integrates the | ||
[IdPyOIDC](https://idpy-oidc.readthedocs.io/en/latest/) library with the | ||
MIRACL Trust platform. | ||
 | ||
|
||
This is an example of an [OIDC integration](https://miracl.com/resources/docs/guides/authentication/oidc/) | ||
with the [MIRACL Trust platform](https://miracl.com) using Python. | ||
|
||
# Dependencies | ||
|
||
This sample uses [IdPyOIDC](https://idpy-oidc.readthedocs.io/en/latest/) library | ||
to integrate with the MIRACL Trust platform. | ||
|
||
# Setup | ||
|
||
The sample can be run directly with Python or with a Docker container. If you choose | ||
the latter, follow the instructions [here](../../README.md). | ||
|
||
To start an OIDC integration, you must create an OIDC application in the | ||
[MIRACL Trust Portal](https://trust.miracl.com) as described [here](https://miracl.com/resources/docs/get-started/low-code/). | ||
The `Redirect URL` must be the same as the one the sample is run with. If you use the | ||
sample's default value, it must be set to `http://localhost:8000/login`. | ||
You must pass the app's credentials to the sample through environment | ||
variables as follows: | ||
|
||
``` bash | ||
export CLIENT_ID=<client-id> | ||
export CLIENT_SECRET=<client-secret> | ||
``` | ||
|
||
# Usage | ||
|
||
To run the sample, you need first to (setup)[https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/] | ||
your environment. | ||
|
||
```bash | ||
cd samples/python | ||
python3 -m venv .venv | ||
source .venv/bin/activate | ||
python3 -m pip install -r requirements.txt | ||
|
||
python app.py --client-id CLIENTID --client-secret CLIENTSECRET | ||
``` | ||
|
||
This runs a sample HTTP server and when you open http://localhost:8000/, | ||
it navigates you to the MIRACL Trust authorization page to start the | ||
registration and authentication. |