Comments (9)
The only complication is that some of the emails are generated by overnight (eg batch) processes, so we can't use a redirect_uri ever.
Is it not "just" a case of obtaining a refresh token once and then providing that to whatever needs to use it?
I've found examples that work with IMAP (like this one) but nothing that works with SMTP that can be navigated completely via an API without any human intervention.
It's unclear where you were looking? In this repository, there's Java code and Python code that uses both IMAP and SMTP as well as Go code that uses SMTP.
from gmail-oauth2-tools.
from gmail-oauth2-tools.
In this example (https://oauth2-client.thephpleague.com/usage/) we retrieve
a provider using an API call that requires a "redirect_url". I couldn't
find any examples where this wasn't the case.
As per https://developers.google.com/identity/protocols/oauth2/resources/oob-migration, Google no longer supports the use of the OAuth2 OOB flow, so a redirect URI will always be required. However, https://github.com/thephpleague/oauth2-google does cover obtaining a refresh token once and subsequently exchanging it as needed for an access token, at which point the redirect URI shouldn't be involved. I'm completely unfamiliar with the PHP ecosystem, alas, so I don't have recommendations regarding SMTP libraries that support OAuth2.
from gmail-oauth2-tools.
from gmail-oauth2-tools.
'access_type' => "offline",
'redirect_uri' => "https://sobs.com.au/ui/xoauth2config.php?schoolid=15"
Those keys should be accessType
and redirectUri
, respectively, I believe?
Do you have any pointers as to where I should be looking?
Are there any debug options with the Google library?
Sorry, I know nothing about https://github.com/thephpleague/oauth2-google beyond what I saw in their README.md
file. (And the only reason I know of it is because you had linked to their documentation previously.) I suggest asking for some help over on their issue tracker? I note that @shadowhand landed a few commits yesterday, so it's evidently still actively maintained. :)
from gmail-oauth2-tools.
from gmail-oauth2-tools.
The expiry isn't clear, is it an expiry for the accessToken or the
refreshToken or both? Does the refreshToken actually expire???
A refresh token doesn't expire (AFAIK) whereas an access token does expire. The refresh token will be revoked, I think, when either the user's password is changed or the application's access is removed.
I ran it again and the second time I only received an accessToken, no
refreshToken. Are there some rules around issuing refreshTokens???
I'm not sure, TBH, but setting prompt
to consent
in addition to setting accessType
to offline
may or may not help here.
from gmail-oauth2-tools.
from gmail-oauth2-tools.
You're welcome. Glad to help. :)
from gmail-oauth2-tools.
Related Issues (20)
- 401 errors HOT 1
- oauth2.py: Bad Request error, invalid grant HOT 2
- oauth2.py stopped to work - urllib.py, httplib.py and socket.py issues HOT 8
- sendgmail: use the GMail API instead of SMTP HOT 22
- API probably doesn't send "refresh_token"s anymore. HOT 1
- .
- B
- Yahoo
- Update sendgmail's instructions HOT 1
- GMail refresh token retrieval no longer working HOT 4
- oauth2.py uses outdated urls HOT 1
- Unclear how to register an application, establish a client-id HOT 1
- Gmail
- Gmail
- Python: SyntaxError: invalid syntax - Generate a Token HOT 1
- Python3 version? HOT 3
- How to Authenticator bypass or disable for google account HOT 1
- sendgmail: refresh token hack no longer works HOT 1
- sendgmail: consider using localhost to get the oauth2 token HOT 2
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 gmail-oauth2-tools.