---
title: AuthorizationCopyPrivilegedReference
framework: security
role: symbol
role_heading: Function
path: security/authorizationcopyprivilegedreference
---

# AuthorizationCopyPrivilegedReference

Retrieves the authorization reference passed by the AuthorizationExecuteWithPrivileges function.

## Declaration

```occ
OSStatus AuthorizationCopyPrivilegedReference(AuthorizationRef*authorization, AuthorizationFlags flags);
```

## Parameters

- `authorization`: A pointer to an authorization reference. The Security Server allocates the authorization reference for you, so you do not need to call the function doc://com.apple.security/documentation/Security/AuthorizationCreate(_:_:_:_:). On return, it points to a copy of the authorization reference used in the call to the doc://com.apple.security/documentation/Security/AuthorizationExecuteWithPrivileges function.
- `flags`: Reserved options. Pass the doc://com.apple.security/documentation/Security/AuthorizationFlags/kAuthorizationFlagDefaults constant.

## Return Value

Return Value A result code. See Authorization Services Result Codes.

## Discussion

Discussion important: This function is deprecated. Use a launchd-launched helper tool and/or the Service Management framework for this functionality. This function retrieves the authorization reference you pass in the function AuthorizationExecuteWithPrivileges. The new process can use the authorization reference to verify authorizations obtained by the calling process.
