IdentityCredential: configURL property

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

Thuộc tính chỉ đọc configURL của giao diện IdentityCredential trả về một chuỗi chỉ định URL tệp cấu hình của nhà cung cấp danh tính (IdP) được sử dụng để đăng nhập.

Xem Cung cấp tệp cấu hình để biết thêm thông tin.

Giá trị

Một chuỗi.

Ví dụ

Đăng nhập liên kết cơ bản và truy cập configURL

Các bên tin cậy (RP) có thể gọi navigator.credentials.get() với tùy chọn identity để thực hiện yêu cầu đăng nhập:

js
async function signIn() {
  const identityCredential = await navigator.credentials.get({
    identity: {
      providers: [
        {
          configURL: "https://accounts.idp.example/config.json",
          clientId: "********",
          params: {
            /* IdP-specific parameters */
          },
        },
      ],
    },
  });

  console.log(identityCredential.configURL);
}

Thông số kỹ thuật

Specification
Federated Credential Management API
# dom-identitycredential-configurl

Tương thích trình duyệt

Xem thêm