RpcBindingInqAuthInfo  2BH_ZT

The RpcBindingInqAuthInfo function returns authentication and authorization information from a binding handle.

#include <rpc.h>

RPC_STATUS RPC_ENTRY RpcBindingInqAuthInfo(

    RPC_BINDING_HANDLE  Binding,

 

    unsigned char * *  ServerPrincName,

 

    unsigned long *  AuthnLevel,

 

    unsigned long *  AuthnSvc,

 

    RPC_AUTH_IDENTITY_HANDLE *  AuthIdentity,

 

    unsigned long *  AuthzSvc

 

   );

 

 

Parameters

Binding

Specifies the server binding handle from which authentication and authorization information is returned.

ServerPrincName

Returns a pointer to a pointer to the expected principal name of the server referenced in the Binding argument. The content of the returned name and its syntax are defined by the authentication service in use.

Specify a null value to prevent RpcBindingInqAuthInfo from returning the ServerPrincName argument. In this case, the application does not call the RpcStringFree routine.

AuthnLevel

Returns a pointer to the level of authentication used for remote procedure calls made using the Binding binding handle.  For a list of the RPC-supported authentication levels, see Authentication-Level ConstantsVGIVU_. Specify a null value to prevent the routine from returning the AuthnLevel argument.

The level returned in the AuthnLevel argument may be different from the level specified when the client called the RpcBindingSetAuthInfo routine. This discrepancy happens when the authentication level specified by the client was not supported by the RPC run-time library and the run-time library automatically upgraded to the next higher level.

AuthnSvc

Returns a pointer to the authentication service specified for remote procedure calls made using the Binding binding handle.  For a list of the RPC-supported authentication services, see Authentication-Service ConstantsAQ3ZA5.

Specify a null value to prevent RpcBindingInqAuthInfo from returning the AuthnSvc argument.

AuthIdentity

Returns a pointer to a handle to the data structure that contains the client s authentication and authorization credentials specified for remote procedure calls made using the Binding binding handle.

Specify a null value to prevent RpcBindingInqAuthInfo from returning the AuthIdentity argument.

AuthzSvc

Returns a pointer to the authorization service requested by the client application that made the remote procedure call on the Binding binding handle.  For a list of the RPC-supported authentication services, see Authentication-Service ConstantsAQ3ZA5.

Specify a null value to prevent RpcBindingInqAuthInfo from returning the AuthzSvc argument.

 

Remarks

A client application calls the RpcBindingInqAuthInfo routine to view the authentication and authorization information associated with a server binding handle. The client specifies the data by calling the RpcBindingSetAuthInfo routine.

The RPC run-time library allocates memory for the returned ServerPrincName argument. The application is responsible for calling the RpcStringFree routine for that returned argument string.

When a client application does not know a server s principal name, calling RpcBindingInqAuthInfo after making a remote procedure call provides the server s principal name. For example, clients that import from a group or profile may not know a server s principal name when calling the RpcBindingSetAuthInfo routine.

Return Values

Value

Meaning

RPC_S_OK

Success

RPC_S_INVALID_BINDING

Invalid binding handle

RPC_S_WRONG_KIND_OF_BINDING

Wrong kind of binding for operation

RPC_BINDING_HAS_NO_AUTH

Binding has no authentication information

 

See Also

RpcBindingSetAuthInfo, RpcStringFree