File tree Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Expand file tree Collapse file tree 3 files changed +36
-4
lines changed Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ send-email`.
2222 * Follow the steps in the ** Authorize credentials for a desktop
2323 application** section. However, set the application type to * Web
2424 application* (i.e. instead of * Desktop app* ) and then add
25- ` https://oauth2.dance/ ` as an authorised redirect URI. This is necessary
26- for seeing the authorisation code on a page in your browser.
25+ ` https://google.github.io/gmail-oauth2-tools/html/oauth2.dance.html `
26+ as an authorised redirect URI. This is necessary for seeing the
27+ authorisation code on a page in your browser.
2728
2829 * When you download the credentials as JSON, create the
2930 ` ${XDG_CONFIG_HOME:-${HOME}/.config}/sendgmail ` directory with file mode
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < meta charset ="utf-8 ">
3+ < meta name ="viewport " content ="width=device-width, initial-scale=1 ">
4+ < style > : root { color-scheme : dark light; }</ style >
5+ < title > oauth2.dance</ title >
6+ < h1 > oauth2.dance</ h1 >
7+ < div id ="authCodeDivFailure " style ="display: none; ">
8+ These aren't the droids you're looking for.
9+ </ div >
10+ < div id ="authCodeDivSuccess " style ="display: none; ">
11+ Authorisation Code:
12+ < span id ="authCodeSpan " style ="font-family: monospace; font-weight: bold; "> </ span >
13+ < br >
14+ < button id ="authCodeButton "> Copy To Clipboard</ button >
15+ </ div >
16+ < script >
17+ var searchParams = new URLSearchParams ( window . location . search ) ;
18+ var code = searchParams . get ( "code" ) ;
19+ if ( code === null ) {
20+ var div = document . getElementById ( "authCodeDivFailure" ) ;
21+ div . style = "" ;
22+ } else {
23+ var button = document . getElementById ( "authCodeButton" ) ;
24+ button . addEventListener ( "click" , ( e ) => { navigator . clipboard . writeText ( code ) ; } ) ;
25+ var span = document . getElementById ( "authCodeSpan" ) ;
26+ span . textContent = code ;
27+ var div = document . getElementById ( "authCodeDivSuccess" ) ;
28+ div . style = "" ;
29+ }
30+ </ script >
Original file line number Diff line number Diff line change 2222registering and for documentation of the APIs invoked by this code.
2323
2424NOTE: The OAuth2 OOB flow isn't a thing anymore. You will need to set the
25- application type to "Web application" and then add https://oauth2.dance/ as an
25+ application type to "Web application" and then add
26+ https://google.github.io/gmail-oauth2-tools/html/oauth2.dance.html as an
2627authorised redirect URI. This is necessary for seeing the authorisation code on
2728a page in your browser.
2829
@@ -134,7 +135,7 @@ def SetupOptionParser():
134135
135136
136137# Hardcoded redirect URI.
137- REDIRECT_URI = 'https://oauth2.dance/ '
138+ REDIRECT_URI = 'https://google.github.io/gmail- oauth2-tools/html/oauth2 .dance.html '
138139
139140
140141def AccountsUrl (command ):
You can’t perform that action at this time.
0 commit comments