Skip to content

Commit

Permalink
Merge pull request #1 from EchoesHQ/fix-signed-installation
Browse files Browse the repository at this point in the history
Fix signed installation token validation
  • Loading branch information
AdrienFromToulouse authored Jan 14, 2022
2 parents 7ac6e02 + cbc088d commit d3fb94b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apicommunication/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,11 @@ func ValidateInstallRequest(r *http.Request, st storage.Store) error {
if err != nil {
return nil, fmt.Errorf("reading public key from atlassian: %w", err)
}
return kidPKey, nil
// The JWT is signed with a private key using the RS256 algorithm.
// Reference: https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/#signed-installation-callback-requests
return jwt.ParseRSAPublicKeyFromPEM(kidPKey)
}
return []byte{}, nil
return nil, nil
})
if err != nil {
if _, ok := err.(*jwt.ValidationError); ok {
Expand Down

0 comments on commit d3fb94b

Please sign in to comment.