Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PHP library and example dependencies and add containerization for example #26

Merged
merged 4 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ return (new AuthTokenValidatorBuilder($log))
->withTrustedCertificateAuthorities(...self::trustedIntermediateCACertificates())
->build();
```
Read more about [LoggerInterface](https://www.php-fig.org/psr/psr-3/) and take a look from examples directory.
Read more about [LoggerInterface](https://www.php-fig.org/psr/psr-3/) and take a look at the usage examples in the `example` directory.

## 2. Configure the challenge nonce store

Expand Down Expand Up @@ -211,7 +211,7 @@ try {
}
...
```
See the complete example from the ***examples*** directory.
See the complete example in the `example` directory.


# Table of contents
Expand Down Expand Up @@ -367,17 +367,32 @@ $generator = (new ChallengeNonceGeneratorBuilder())

# Example implementation

Take the files from the `examples` folder and change the tokenValidator site origin.
An example implementation is provided in the `example` directory. Please update the site origin in the `tokenValidator()` function before running it.

Execute the following composer commands:
Example implementation uses AltoRouter (https://dannyvankooten.github.io/AltoRouter/) and works out of the box in Apache with mod_rewrite module. Use `example/public/.htaccess` and https://dannyvankooten.github.io/AltoRouter/usage/rewrite-requests.html for reference if you want to use a different web server.

Take the files from the `example` folder. You can rename this folder but in this documentation we still refer it as `example` folder.

Create new folder `certificates` in `example` folder.

Download ESTEID2018 certificates in DER format from https://www.skidsolutions.eu/en/repository/certs
and put them in `certificates` folder.

Execute the following composer commands to install dependencies:

```
composer install
composer dump-autoload
```

Please note, that there are no certificate files included in this example. You can find certificates from [here](https://www.skidsolutions.eu/en/repository/certs)
Change origin url (used by token validator) to match the url you are running the example on (set to https://localhost by default) by changing the array key `origin_url` in `example/src/app.conf.php`. You can also override settings with environmental variable that is constructed by appending uppercased setting name to prefix 'WEB_EID_SAMPLE_'. This is useful for example in containerized environments like docker.

For example to override origin_url set environmental variable:

```
WEB_EID_SAMPLE_ORIGIN_URL
```
Point your Apache web server Document Root to `/example/public` folder.

# Dependency versioning policy

Expand Down
Loading