Seat: switch from seatconnect to cupraconnect loging (#8773)
This commit is contained in:
parent
9d4bc2aea7
commit
52dbfab5ac
3 changed files with 8 additions and 31 deletions
|
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/evcc-io/evcc/api"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/evcc-io/evcc/util/request"
|
||||
"github.com/evcc-io/evcc/vehicle/seat"
|
||||
"github.com/evcc-io/evcc/vehicle/seat/cupra"
|
||||
"github.com/evcc-io/evcc/vehicle/vag/tokenrefreshservice"
|
||||
"github.com/evcc-io/evcc/vehicle/vag/vwidentity"
|
||||
|
|
@ -51,12 +52,12 @@ func NewCupraFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
log := util.NewLogger("cupra").Redact(cc.User, cc.Password, cc.VIN)
|
||||
|
||||
// get initial VW identity id_token
|
||||
q, err := vwidentity.Login(log, cupra.AuthParams, cc.User, cc.Password)
|
||||
q, err := vwidentity.Login(log, seat.AuthParams, cc.User, cc.Password)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trs := tokenrefreshservice.New(log, cupra.TRSParams)
|
||||
trs := tokenrefreshservice.New(log, seat.TRSParams)
|
||||
token, err := trs.Exchange(q)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
package cupra
|
||||
|
||||
import "net/url"
|
||||
|
||||
// const (
|
||||
// Brand = "VW"
|
||||
// Country = "ES"
|
||||
|
||||
// // Authorization ClientID
|
||||
// AuthClientID = "9d183b70-d129-424f-9a26-c3778edf95e1"
|
||||
// )
|
||||
|
||||
// Authorization parameters
|
||||
var AuthParams = url.Values{
|
||||
"response_type": {"code id_token"}, // token
|
||||
"client_id": {"30e33736-c537-4c72-ab60-74a7b92cfe83@apps_vw-dilab_com"},
|
||||
"redirect_uri": {"cupraconnect://identity-kit/login"},
|
||||
"scope": {"openid profile mbb"}, // cars birthdate nickname address phone
|
||||
}
|
||||
|
||||
// TokenRefreshService parameters
|
||||
var TRSParams = url.Values{
|
||||
"brand": {"cupra"},
|
||||
}
|
||||
|
|
@ -7,18 +7,18 @@ const (
|
|||
Country = "ES"
|
||||
|
||||
// Authorization ClientID
|
||||
AuthClientID = "9dcc70f0-8e79-423a-a3fa-4065d99088b4"
|
||||
AuthClientID = "9d183b70-d129-424f-9a26-c3778edf95e1"
|
||||
)
|
||||
|
||||
// Authorization parameters
|
||||
var AuthParams = url.Values{
|
||||
"response_type": {"code id_token"},
|
||||
"client_id": {"50f215ac-4444-4230-9fb1-fe15cd1a9bcc@apps_vw-dilab_com"},
|
||||
"redirect_uri": {"seatconnect://identity-kit/login"},
|
||||
"response_type": {"code id_token"}, // token
|
||||
"client_id": {"30e33736-c537-4c72-ab60-74a7b92cfe83@apps_vw-dilab_com"},
|
||||
"redirect_uri": {"cupraconnect://identity-kit/login"},
|
||||
"scope": {"openid profile mbb"}, // cars birthdate nickname address phone
|
||||
}
|
||||
|
||||
// TokenRefreshService parameters
|
||||
var TRSParams = url.Values{
|
||||
"brand": {"seat"},
|
||||
"brand": {"cupra"},
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue