code: def register_client(provider_info, redirect_uris):
      
      client_type = check_redirect_uris(redirect_uris)
  
      submit_info = {'redirect_uris': redirect_uris,
                     'application_type': client_type,
                     'token_endpoint_auth_method': 'client_secret_post'}
  
      headers = {'Content-type': 'application/json'}
  
      resp, content = httplib2.Http().request(
          provider_info['registration_endpoint'], 'POST',
          json.dumps(submit_info), headers=headers)
  
      if int(resp['status']) >= 400:
          raise Exception('Error: the server returned HTTP ' + resp['status'])
  
      client_info = _json_loads(content)
  
      if 'error' in client_info:
          raise Exception('Error occured during registration: %s (%s)'
                          % (client_info['error'],
                             client_info.get('error_description')))
  
      json_file = {'web': {
          'client_id': client_info['client_id'],
          'client_secret': client_info['client_secret'],
          'auth_uri': provider_info['authorization_endpoint'],
          'token_uri': provider_info['token_endpoint'],
          'userinfo_uri': provider_info['userinfo_endpoint'],
          'redirect_uris': redirect_uris,
          'issuer': provider_info['issuer'],
      }}
  
      return json_file
docs: This function registers a new client with the specified OpenID Provider,
      and then returns the regitered client ID and other information.
  
      :param provider_info: The contents of the discovery endpoint as
          specified by the OpenID Connect Discovery 1.0 specifications.
      :type provider_info: dict
      :param redirect_uris: The redirect URIs the application wants to
          register.
      :type redirect_uris: list
      :returns: An object containing the information needed to configure the
          actual client code to communicate with the OpenID Provider.
      :rtype: dict
      :raises ValueError: The same error as used by check_redirect_uris.
      :raises RegistrationError: Indicates an error was returned by the OpenID
          Provider during registration.
  
      .. versionadded:: 1.0