-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add support for microsoft services #171
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
warcooft
wants to merge
10
commits into
datamweb:develop
Choose a base branch
from
warcooft:feat-microsoft-services
base: develop
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 all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7bb976e
feat: add support for microsoft services
warcooft b89edde
make PHPStan happy
warcooft 7207536
add PHPDoc
warcooft 0f021ef
improve PHPDoc
warcooft 082657b
rm white space
warcooft e21fcdd
docs: update README.md
warcooft c5de781
lang: small typo
warcooft 3993ca0
add microsoft oauth button
warcooft 2ad2750
rm avatar attributes from syncing user info to avoid replacing the cu…
warcooft 28960c2
fix coding standards
warcooft 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
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
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
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
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 |
---|---|---|
|
@@ -2,9 +2,10 @@ | |
|
||
It is strongly recommended that only people who have already read the documents in full should use this section. The purpose of providing this section is to save the time of people and developers who frequently use `Shield OAuth` in different projects. | ||
|
||
### Step 1 : | ||
### Step 1 : | ||
|
||
Installing the package by Composer : | ||
|
||
```console | ||
composer require datamweb/shield-oauth:dev-develop | ||
``` | ||
|
@@ -17,24 +18,27 @@ Add `first_name`, `last_name`, and `avatar` columns to table `users` : | |
php spark migrate -n Datamweb\ShieldOAuth | ||
``` | ||
|
||
### Step 3 : | ||
### Step 3 : | ||
|
||
- Add `{{ShieldOAuthButtonForLoginPage}}` to `vendor\codeigniter4\shield\src\Views\login.php` | ||
- Add `{{ShieldOAuthButtonForRegisterPage}}` to `vendor\codeigniter4\shield\src\Views\register.php` | ||
- Add | ||
|
||
- Add `{{ShieldOAuthButtonForLoginPage}}` to `vendor\codeigniter4\shield\src\Views\login.php` | ||
- Add `{{ShieldOAuthButtonForRegisterPage}}` to `vendor\codeigniter4\shield\src\Views\register.php` | ||
- Add | ||
```php | ||
<?= $this->section('pageScripts') ?> | ||
<script src='https://cdn.jsdelivr.net/npm/@popperjs/[email protected]/dist/umd/popper.min.js' integrity='sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3' crossorigin='anonymous'></script> | ||
<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js' integrity='sha384-IDwe1+LCz02ROU9k972gdyvl+AESN10+x7tBKgc9I5HFtuNz0wWnPclzo6p9vxnk' crossorigin='anonymous'></script> | ||
<?= $this->endSection() ?> | ||
``` | ||
to `vendor\codeigniter4\shield\src\Views\login.php` and `vendor\codeigniter4\shield\src\Views\register.php`. | ||
|
||
### Step 4 : | ||
|
||
to `vendor\codeigniter4\shield\src\Views\login.php` and `vendor\codeigniter4\shield\src\Views\register.php`. | ||
|
||
### Step 4 : | ||
|
||
Receive keys `client_id` and `client_secret` from each OAuth server. and setting them in file `app\Config\ShieldOAuthConfig.php`. | ||
|
||
callBack address is `https://yourBaseURL.com/oauth/call-back`. | ||
|
||
```php | ||
public array $oauthConfigs = [ | ||
'github' => [ | ||
|
@@ -47,6 +51,11 @@ public array $oauthConfigs = [ | |
'client_secret' => 'fsdfsdfsgdgrdg', | ||
// ... | ||
], | ||
'microsoft' => [ | ||
'client_id' => 'example-098a-43sd-9813-9747f3gg6f6h', | ||
'client_secret' => 'example-qw53-446r-tyy1-856ff9ue8fdf', | ||
// ... | ||
], | ||
// and other services... | ||
``` | ||
|
||
|
@@ -57,9 +66,10 @@ public array $oauthConfigs = [ | |
> php spark make:oauthconfig | ||
> ``` | ||
|
||
### Step 5 : | ||
### Step 5 : | ||
|
||
Cancel filter for `Shield OAuth` routes. | ||
|
||
```php | ||
public $globals = [ | ||
'before' => [ | ||
|
@@ -71,4 +81,5 @@ public $globals = [ | |
``` | ||
|
||
### Step 6 : | ||
|
||
See `https://yourBaseURL.com/login` Or `https://yourBaseURL.com/register` Use and enjoy! |
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
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
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
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
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
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
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.