ONVIF Profile V OAuth2 client_secret_basic Mode Introduction

Starting today, we will analyze the workflow of each mode one by one. First, let’s take a look at client_secret_basic:

  1. Upload the OAuth2 server certificate. Note that there is no PrivateKey here
 <UploadCertificate xmlns="http://www.onvif.org/ver10/advancedsecurity/wsdl">
      <Certificate>MIIBlTCCATqgAwIBAgIICN9G9kZld4UwCgYIKo...g==</Certificate>
      <Alias>T1</Alias>
      <PrivateKeyRequired>false</PrivateKeyRequired>
    </UploadCertificate>

  1. Create a CertPathValidationPolicy, where the TrustAnchor is the certificate just uploaded:
    <CreateCertPathValidationPolicy xmlns="http://www.onvif.org/ver10/advancedsecurity/wsdl">
      <Alias>AuthServer1</Alias>
      <Parameters>
        <UseDeltaCRLs>true</UseDeltaCRLs>
      </Parameters>
      <TrustAnchor>
        <CertificateID>Cert-56666afc-20d2-49a4-bde5-59619a56f5c3</CertificateID>
      </TrustAnchor>
    </CreateCertPathValidationPolicy>

  1. Configure the OAuth2 service, with the corresponding Policy being the PolicyID just created:
    <CreateAuthorizationServerConfiguration xmlns="http://www.onvif.org/ver10/advancedsecurity/wsdl">
      <Configuration Type="OAuthClientCredentials" ClientAuth="client_secret_basic">
        <ServerUri>https://10.168.1.195:10288/.well-known/openid-configuration</ServerUri>
        <ClientID>client1</ClientID>
        <ClientSecret>client-secret1</ClientSecret>
        <Scope>scopeA</Scope>
        <CertPathValidationPolicyID>Policy-29265fe2-d46f-4c10-b752-21017681697c</CertPathValidationPolicyID>
      </Configuration>
    </CreateAuthorizationServerConfiguration>	
  1. Upload the Uplink service certificate again and create the corresponding Policy, then configure the Uplink service:
    <SetUplink xmlns="http://www.onvif.org/ver10/uplink/wsdl">
      <Configuration>
        <RemoteAddress>wss://10.168.1.195:10295</RemoteAddress>
        <UserLevel>Administrator</UserLevel>
        <CertPathValidationPolicyID>Policy-f038c742-bdbd-47f5-9cfb-9ebb39ed3f35</CertPathValidationPolicyID>
        <AuthorizationServer>AuthSrv-4cfd911b-7652-4bda-ae44-4a479e4d6435</AuthorizationServer>
      </Configuration>
    </SetUplink>