-
Notifications
You must be signed in to change notification settings - Fork 434
chore: upgrade packages in protect-page-login example in php #2336
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
Open
wassimoo
wants to merge
6
commits into
master
Choose a base branch
from
wassimoo/upgrade-packages-protect-page-login-php
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
40cb13c
chore: update PHP dependencies and add README for protect-page-login …
wassimoo a5cc663
docs: improve formatting in README for protect-page-login example
wassimoo c9f97d4
chore: add missing newline at end of composer.json for protect-page-l…
wassimoo d185f03
docs: refine README description for protect-page-login example
wassimoo c7b106a
docs: update README title for clarity in protect-page-login example
wassimoo 1a353dd
docs: update README title to reflect authentication focus in protect-…
wassimoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # Protect page login Example in PHP | ||
|
|
||
| This example demonstrates protecting a page in a PHP web app using the Ory PHP | ||
wassimoo marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| SDK and the Ory Account Experience. | ||
|
|
||
| For the full step-by-step guide, see: | ||
| [Integrate authentication into PHP](https://www.ory.sh/docs/getting-started/integrate-auth/php) | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - PHP 8.1+ | ||
| - Composer | ||
| - Node.js (to run the Ory CLI via `npx`) | ||
| - An Ory Network project and the Ory CLI logged in | ||
|
|
||
| ## Install dependencies | ||
|
|
||
| ```bash | ||
| composer install | ||
| ``` | ||
|
|
||
| ## Run locally | ||
|
|
||
| 1. Start the PHP built-in server: | ||
|
|
||
| ```bash | ||
| php -S 127.0.0.1:3000 | ||
| ``` | ||
|
|
||
| 2. In another terminal, start the Ory Tunnel pointing to your local app and | ||
| project: | ||
|
|
||
| ```bash | ||
| npx @ory/cli tunnel --dev http://localhost:3000 --project <project_id> | ||
| ``` | ||
|
|
||
| 3. Open http://localhost:3000 in your browser. You will be redirected to the Ory | ||
| Account Experience for sign-in, and then returned to the protected page. | ||
|
|
||
| ## Notes | ||
|
|
||
| - The app reads the tunnel port from `TUNNEL_PORT` (defaults to `4000`). | ||
| - The middleware uses `toSession` to validate the user session and redirects | ||
| unauthenticated users to the login UI served via the Ory Tunnel. | ||
This file contains hidden or 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,6 +1,7 @@ | ||
| { | ||
| "require": { | ||
| "ory/client": "^1.20", | ||
| "php": ">=8.1", | ||
| "ory/client": "^1.22.8", | ||
| "bramus/router": "^1.6" | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.