Comments (3)
@stacybot123 can you elaborate more please
from laravel-gmail.
@dacastro4 , thank you for quick reply. I am using this SDK from a while and I love this. Thank you for putting efforts in making this.
The state variable can be used to send a custom value with with the OAuth request. For example : if every user on the app have their custom subdomain (wildcard subdomain) it is impossible to add each of them on the google app, or to disable cross site forgery. So google can pass the state with the request and identify the user and redirect back to the correct resource.
If I use the google client directly it can be used as below:
$client = new Google_Client();
$client->setClientId('XXXXXXXXXXXX');
$client->setClientSecret('XXXXXXXXXXXXX');
$client->setAccessType('offline');
$client->addScope(Google_Service_Gmail::GMAIL_SEND);
$client->setRedirectUri('https://app.example.com/oauth2callback');
$client->setState('mycustom_value');
$client->setIncludeGrantedScopes(true);
$auth_url = $client->createAuthUrl();
header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
The data it will receive after the OAuth validation on server will look like this:
array (
'state' => 'mycustom_value',
'code' => 'XXXXXXXXXXXXXXXXXXX',
'scope' => 'https://www.googleapis.com/auth/gmail.send',
)
Here is the doc on google which have the info
from laravel-gmail.
@stacybot123 I check the code and I don't have the state as a variable that can be set.
from laravel-gmail.
Related Issues (20)
- production.ERROR: refresh token must be passed in or set as part of setAccessToken {"userId":1,"exception":"[object] (LogicException(code: 0): refresh token must be passed in or set as part of setAccessToken at /home/forge/website/vendor/google/apiclient/src/Client.php:332) HOT 2
- Getting error while replying to email HOT 4
- Send Email BCC not working
- Get signature of the user
- Enable function for application wide access
- I have got issue in php version 8.1 Is it available for PHP version 8.1 or laravel10? HOT 2
- Error 400: redirect_uri_mismatch
- refresh token must be passed in or set as part of setaccesstoken HOT 2
- An address can be an instance of Address or a string ("array" given).
- Not supported for Laravel 10 HOT 3
- Multiple user login not working HOT 3
- Hello HOT 1
- Google\\Service\\Exception 401 Request had invalid authentication credentials.
- Can you provide a method for forwarding the email
- Dacastro4\LaravelGmail\Services\Message\Mail::__construct(): Argument #1 ($message) must be of type ?Google_Service_Gmail_Message, Google\Service\Exception given HOT 6
- bootstrap-3.3.7.min.js: 6 vulnerabilities (highest severity is: 6.1)
- jquery-3.1.1.min.js: 4 vulnerabilities (highest severity is: 6.1) - autoclosed HOT 1
- google/apiclient-v2.2.3: 9 vulnerabilities (highest severity is: 9.1)
- orchestra/testbench-v3.5.5: 8 vulnerabilities (highest severity is: 9.8)
- Error when replying an email HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-gmail.