Skip to content

Commit

Permalink
Set OAuth2 default redirect URL
Browse files Browse the repository at this point in the history
  • Loading branch information
josaphatim committed May 18, 2024
1 parent cea402c commit 95440a8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,22 @@ DYNAMIC_MAIL_SUBDOMAIN=""
#github.com
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_REDIRECT_URI=
GITHUB_REDIRECT_URI=http://localhost/?page=home
GITHUB_AUTH_URL=https://github.com/login/oauth/authorize
GITHUB_AUTH_URL=https://github.com/login/oauth/access_token

#gmail
GMAIL_CLIENT_ID=
GMAIL_CLIENT_SECRET=
GMAIL_CLIENT_URI=
GMAIL_CLIENT_URI=http://localhost/?page=home
GMAIL_AUTH_URI=https://accounts.google.com/o/oauth2/auth
GMAIL_TOKEN_URI=https://www.googleapis.com/oauth2/v3/token
GMAIL_REFRESH_URI=https://www.googleapis.com/oauth2/v3/token

#aoutlook
OUTLOOK_CLIENT_ID=
OUTLOOK_CLIENT_SECRET=
OUTLOOK_CLIENT_URI=
OUTLOOK_CLIENT_URI=http://localhost/?page=home
OUTLOOK_AUTH_URI=https://login.live.com/oauth20_authorize.srf
OUTLOOK_TOKEN_URI=https://login.live.com/oauth20_token.srf
OUTLOOK_REFRESH_URI=https://login.live.com/oauth20_token.srf
Expand Down
2 changes: 1 addition & 1 deletion config/github.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'github' => [
'client_id' => env('GITHUB_CLIENT_ID', ''),
'client_secret' => env('GITHUB_CLIENT_SECRET', ''),
'redirect_uri' => env('GITHUB_REDIRECT_URI', ''),
'redirect_uri' => env('GITHUB_REDIRECT_URI', 'http://localhost/?page=home'),
'auth_url' => env('GITHUB_AUTH_URL', 'https://github.com/login/oauth/authorize'),
'token_url' => env('GITHUB_TOKEN_URL', 'https://github.com/login/oauth/access_token'),
],
Expand Down
17 changes: 6 additions & 11 deletions config/oauth2.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,15 @@
| Constants used for oauth2 authentication over IMAP
| -------------------------------------------------
|
| Once you edit this file, you must move it to the directory defined by
| app_data_dir in your config/app.php file. No need to re-run the
| config_gen.php script.
|
| Do not forget to add the service to $services = ['gmail', 'outlook']; in
| oauth2_setup function from modules/nux/modules.php
|
| SECURITY ALERT ! MAKE SURE THAT THIS FILE IS NOT ACCESSIBLE BY THE BROWSER !
|
| Currently there are only two popular E-mail providers supporting IMAP/oauth2,
| Outlook and Gmail. In order to use oauth2 you must create a web application
| that generates a client id, client secret and a redirect URI, then define them
| in this file.
|
| An OAuth2 app can connect multiple accounts by using the user's authorization
| to request unique access tokens for each account during the OAuth2 flow.
| Each token corresponds to a specific user's permissions and account data.
|
| Outlook.com https://account.live.com/developers/applications/
| Gmail: https://console.developers.google.com/project
|
Expand All @@ -29,7 +24,7 @@
'gmail' => [
'client_id' => env('GMAIL_CLIENT_ID', ''),
'client_secret' => env('GMAIL_CLIENT_SECRET', ''),
'client_uri' => env('GMAIL_CLIENT_URI', ''),
'client_uri' => env('GMAIL_CLIENT_URI', 'http://localhost/?page=home'),
'auth_uri' => env('GMAIL_AUTH_URI', 'https://accounts.google.com/o/oauth2/auth'),
'token_uri' => env('GMAIL_TOKEN_URI', 'https://www.googleapis.com/oauth2/v3/token'),
'refresh_uri' => env('GMAIL_REFRESH_URI', 'https://www.googleapis.com/oauth2/v3/token')
Expand All @@ -39,7 +34,7 @@
'outlook' => [
'client_id' => env('OUTLOOK_CLIENT_ID', ''),
'client_secret' => env('OUTLOOK_CLIENT_SECRET', ''),
'client_uri' => env('OUTLOOK_CLIENT_URI', ''),
'client_uri' => env('OUTLOOK_CLIENT_URI', 'http://localhost/?page=home'),
'auth_uri' => env('OUTLOOK_AUTH_URI', 'https://login.live.com/oauth20_authorize.srf'),
'token_uri' => env('OUTLOOK_TOKEN_URI', 'https://login.live.com/oauth20_token.srf'),
'refresh_uri' => env('OUTLOOK_REFRESH_URI', 'https://login.live.com/oauth20_token.srf')
Expand Down

0 comments on commit 95440a8

Please sign in to comment.