File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -119,3 +119,22 @@ func (p *Provider) getWellKnown() (*WellKnown, error) {
119
119
120
120
return p .wellKnown , nil
121
121
}
122
+
123
+ // CanRevoke checks if token can be revoked for this Provider
124
+ func (p * Provider ) CanRevoke () bool {
125
+ return p .wellKnown .RevokeURI != ""
126
+ }
127
+
128
+ // CanSignOut checks if token can be signed out for this Provider
129
+ func (p * Provider ) CanSignOut () bool {
130
+ return p .wellKnown .SignOutURI != ""
131
+ }
132
+
133
+ // AuthBasicHeader gives a string ready to use as Authorization header
134
+ // The returned value contains "Basic " prefix already
135
+ func (p * Provider ) AuthBasicHeader () string {
136
+ id := url .PathEscape (url .QueryEscape (p .clientID ))
137
+ pass := url .PathEscape (url .QueryEscape (p .clientSecret ))
138
+
139
+ return "Basic " + base64 .StdEncoding .EncodeToString ([]byte (id + ":" + pass ))
140
+ }
You can’t perform that action at this time.
0 commit comments