| 262 | } |
| 263 | |
| 264 | func (ah *authHandler) doBasicAuth(ctx context.Context) (string, string, error) { |
| 265 | username, secret := ah.common.Username, ah.common.Secret |
| 266 | |
| 267 | if username == "" || secret == "" { |
| 268 | return "", "", fmt.Errorf("failed to handle basic auth because missing username or secret") |
| 269 | } |
| 270 | |
| 271 | auth := base64.StdEncoding.EncodeToString([]byte(username + ":" + secret)) |
| 272 | return fmt.Sprintf("Basic %s", auth), "", nil |
| 273 | } |
| 274 | |
| 275 | func (ah *authHandler) doBearerAuth(ctx context.Context) (token, refreshToken string, err error) { |
| 276 | // copy common tokenOptions |