google / google/oauth2l

Authentication necessity check function based on cache

Open
#178 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
737
Forks
95
Avg merge
10h 38m
Merged PRs (30d)
2

Description

I would like to write a script in which oauth2l is used. In the script I'd like to write conditional codes depending on authentication necessity (I mean, whether it is necessary to open the consent page on a browser or not). Currently oauth2l doesn't provide such a function and if you want to know whether it is necessary you have to run:
```sh
oauth2l fetch --scope --cache /path/to/cache --credentials /path/to/credentials.json
```
and see whether this message comes up:
```sh
Go to the following link in your browser:

https://accounts.google.com/o/oauth2/auth?......
```
This is inconvenient when embedding oauth2l in scripts. I would like oauth2l to provide a function which checks authentication necessity based on cache. Sadly you don't seem to be able to extract token from cache, so `oauth2l test` command doesn't help.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.