mirror of
https://github.com/go-gitea/gitea
synced 2025-07-06 18:47:19 +00:00
Update markbates/goth (#10444)
- Fixes a JWT decoding issue in the OpenID provider - Updates the GitHub provider to use the authorization header for authentication - Updates the Twitch provider for Twitch's v5 API changes - Adds the email and is_private_email fields to the Apple provider's GetUser implementation - Modifies gothic to export a non-collidable context key for setting the Provider in a context.Context - Adds new scopes to the Spotify provider - Adds the IDToken from OpenID providers on the user struct - Make Apple provider's SecretParams public - Adds support for sign in with Apple, and drops support for Go versions 1.7 and 1.8 - Fixes the Slack provider's FetchURL logic to use the appropriate scope for the info it needs Signed-off-by: Oscar LÃfwenhamn <oscar.lofwenhamn@cgi.com>
This commit is contained in:
13
vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go
generated
vendored
13
vendor/github.com/markbates/goth/providers/openidConnect/openidConnect.go
generated
vendored
@ -6,12 +6,13 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/markbates/goth"
|
||||
"golang.org/x/oauth2"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/markbates/goth"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
const (
|
||||
@ -173,6 +174,7 @@ func (p *Provider) FetchUser(session goth.Session) (goth.User, error) {
|
||||
RefreshToken: sess.RefreshToken,
|
||||
ExpiresAt: expiresAt,
|
||||
RawData: claims,
|
||||
IDToken: sess.IDToken,
|
||||
}
|
||||
|
||||
p.userFromClaims(claims, &user)
|
||||
@ -391,13 +393,8 @@ func decodeJWT(jwt string) (map[string]interface{}, error) {
|
||||
return nil, errors.New("jws: invalid token received, not all parts available")
|
||||
}
|
||||
|
||||
// Re-pad, if needed
|
||||
encodedPayload := jwtParts[1]
|
||||
if l := len(encodedPayload) % 4; l != 0 {
|
||||
encodedPayload += strings.Repeat("=", 4-l)
|
||||
}
|
||||
decodedPayload, err := base64.URLEncoding.WithPadding(base64.NoPadding).DecodeString(jwtParts[1])
|
||||
|
||||
decodedPayload, err := base64.StdEncoding.DecodeString(encodedPayload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user