diff --git a/vehicle/bluelink/api.go b/vehicle/bluelink/api.go index 0a3efae71..9916d4d3d 100644 --- a/vehicle/bluelink/api.go +++ b/vehicle/bluelink/api.go @@ -21,7 +21,7 @@ const ( resOK = "S" // auth fail: F timeFormat = "20060102150405 -0700" // Note: must add timeOffset timeOffset = " +0100" - refreshTimeout = time.Minute + refreshTimeout = 2 * time.Minute statusExpiry = 5 * time.Minute ) diff --git a/vehicle/bluelink/identity.go b/vehicle/bluelink/identity.go index fd231d96b..1308e1d86 100644 --- a/vehicle/bluelink/identity.go +++ b/vehicle/bluelink/identity.go @@ -29,6 +29,7 @@ const ( // Config is the bluelink API configuration type Config struct { URI string + AuthClientID string // v2 BrandAuthUrl string // v2 BasicToken string CCSPServiceID string @@ -150,7 +151,7 @@ func (v *Identity) brandLogin(cookieClient *request.Helper, user, password strin var resp *http.Response if err == nil { - uri := fmt.Sprintf(v.config.BrandAuthUrl, v.config.URI, "en", info.ServiceId, info.UserId) + uri := fmt.Sprintf(v.config.BrandAuthUrl, v.config.AuthClientID, v.config.URI, "en", info.ServiceId, info.UserId) req, err = request.New(http.MethodGet, uri, nil) if err == nil { diff --git a/vehicle/hyundai.go b/vehicle/hyundai.go index 596700952..cb5ca4953 100644 --- a/vehicle/hyundai.go +++ b/vehicle/hyundai.go @@ -47,7 +47,8 @@ func NewHyundaiFromConfig(other map[string]interface{}) (api.Vehicle, error) { BasicToken: "NmQ0NzdjMzgtM2NhNC00Y2YzLTk1NTctMmExOTI5YTk0NjU0OktVeTQ5WHhQekxwTHVvSzB4aEJDNzdXNlZYaG10UVI5aVFobUlGampvWTRJcHhzVg==", CCSPServiceID: "6d477c38-3ca4-4cf3-9557-2a1929a94654", CCSPApplicationID: bluelink.HyundaiAppID, - BrandAuthUrl: "https://eu-account.hyundai.com/auth/realms/euhyundaiidm/protocol/openid-connect/auth?client_id=97516a3c-2060-48b4-98cd-8e7dcd3c47b2&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s", + AuthClientID: "64621b96-0f0d-11ec-82a8-0242ac130003", + BrandAuthUrl: "https://eu-account.hyundai.com/auth/realms/euhyundaiidm/protocol/openid-connect/auth?client_id=%s&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s", } identity, err := bluelink.NewIdentity(log, settings) diff --git a/vehicle/kia.go b/vehicle/kia.go index e6e5c6d0a..1c42277e2 100644 --- a/vehicle/kia.go +++ b/vehicle/kia.go @@ -47,7 +47,8 @@ func NewKiaFromConfig(other map[string]interface{}) (api.Vehicle, error) { BasicToken: "ZmRjODVjMDAtMGEyZi00YzY0LWJjYjQtMmNmYjE1MDA3MzBhOnNlY3JldA==", CCSPServiceID: "fdc85c00-0a2f-4c64-bcb4-2cfb1500730a", CCSPApplicationID: bluelink.KiaAppID, - BrandAuthUrl: "https://eu-account.kia.com/auth/realms/eukiaidm/protocol/openid-connect/auth?client_id=572e0304-5f8d-4b4c-9dd5-41aa84eed160&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s", + AuthClientID: "572e0304-5f8d-4b4c-9dd5-41aa84eed160", + BrandAuthUrl: "https://eu-account.kia.com/auth/realms/eukiaidm/protocol/openid-connect/auth?client_id=%s&scope=openid%%20profile%%20email%%20phone&response_type=code&hkid_session_reset=true&redirect_uri=%s/api/v1/user/integration/redirect/login&ui_locales=%s&state=%s:%s", } identity, err := bluelink.NewIdentity(log, settings)