2 * Copyright (c) 2010-2021 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.bmwconnecteddrive.internal.utils;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
20 * The {@link BimmerConstants} This class holds the important constants for the BMW Connected Drive Authorization. They
21 * are taken from the Bimmercode from github {@link https://github.com/bimmerconnected/bimmer_connected}
22 * File defining these constants
23 * {@link https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/account.py}
24 * https://customer.bmwgroup.com/one/app/oauth.js
26 * @author Bernd Weymann - Initial contribution
29 public class BimmerConstants {
31 // https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/country_selector.py
32 public static final String REGION_NORTH_AMERICA = "NORTH_AMERICA";
33 public static final String REGION_CHINA = "CHINA";
34 public static final String REGION_ROW = "ROW";
36 // https://github.com/bimmerconnected/bimmer_connected/blob/master/bimmer_connected/country_selector.py
37 public static final String AUTH_SERVER_NORTH_AMERICA = "b2vapi.bmwgroup.us/gcdm";
38 public static final String AUTH_SERVER_CHINA = "b2vapi.bmwgroup.cn/gcdm";
39 public static final String AUTH_SERVER_ROW = "b2vapi.bmwgroup.com/gcdm";
40 public static final Map<String, String> AUTH_SERVER_MAP = Map.of(REGION_NORTH_AMERICA, AUTH_SERVER_NORTH_AMERICA,
41 REGION_CHINA, AUTH_SERVER_CHINA, REGION_ROW, AUTH_SERVER_ROW);
43 public static final String OAUTH_ENDPOINT = "/oauth/token";
45 public static final String SERVER_NORTH_AMERICA = "b2vapi.bmwgroup.us";
46 public static final String SERVER_CHINA = "b2vapi.bmwgroup.cn:8592";
47 public static final String SERVER_ROW = "b2vapi.bmwgroup.com";
48 public static final Map<String, String> SERVER_MAP = Map.of(REGION_NORTH_AMERICA, SERVER_NORTH_AMERICA,
49 REGION_CHINA, SERVER_CHINA, REGION_ROW, SERVER_ROW);
51 // see https://github.com/bimmerconnected/bimmer_connected/pull/252/files
52 public static final Map<String, String> AUTHORIZATION_VALUE_MAP = Map.of(REGION_NORTH_AMERICA,
53 "Basic ZDc2NmI1MzctYTY1NC00Y2JkLWEzZGMtMGNhNTY3MmQ3ZjhkOjE1ZjY5N2Y2LWE1ZDUtNGNhZC05OWQ5LTNhMTViYzdmMzk3Mw==",
55 "Basic blF2NkNxdHhKdVhXUDc0eGYzQ0p3VUVQOjF6REh4NnVuNGNEanliTEVOTjNreWZ1bVgya0VZaWdXUGNRcGR2RFJwSUJrN3JPSg==",
57 "Basic ZDc2NmI1MzctYTY1NC00Y2JkLWEzZGMtMGNhNTY3MmQ3ZjhkOjE1ZjY5N2Y2LWE1ZDUtNGNhZC05OWQ5LTNhMTViYzdmMzk3Mw==");
59 public static final String CREDENTIAL_VALUES = "nQv6CqtxJuXWP74xf3CJwUEP:1zDHx6un4cDjybLENN3kyfumX2kEYigWPcQpdvDRpIBk7rOJ";
60 public static final String REDIRECT_URI_VALUE = "https://www.bmw-connecteddrive.com/app/static/external-dispatch.html";
61 public static final String SCOPE_VALUES = "authenticate_user vehicle_data remote_services";
63 public static final String LEGACY_CREDENTIAL_VALUES = "nQv6CqtxJuXWP74xf3CJwUEP:1zDHx6un4cDjybLENN3kyfumX2kEYigWPcQpdvDRpIBk7rOJ";
64 public static final String REFERER_URL = "https://www.bmw-connecteddrive.de/app/index.html";