---
sourceDocument: 호주 API 참조
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ko-KR/api-reference

 Release :

    - australia

ft:locale :

    - ko-KR

ft:publication_title :

    - 호주 API 참조

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# AuthCredential - 범위 지정됨

# AuthCredential - 범위 지정됨 {#ariaid-title1}

* 릴리스 버전: Australia
* 
* 업데이트 날짜 2026년 03월 12일
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 소요 시간: 6분

AuthCredential() API는 REST 요청에 대한 자격 증명을 빌드할 수 있는 메서드를 제공합니다.  
다음 순서로 이러한 API를 사용하여 아웃바운드 서명 요청을 생성합니다.

1. HttpRequestData: API 요청을 빌드합니다.
2. AuthCredential: 자격 증명 개체를 만들거나 기존 개체를 업데이트합니다. 자격 증명을 사용하여 RequestAuthAPI 클래스를 통해 요청에 서명합니다.
3. RequestAuthAPI: 요청에 서명하고 HttpRequestAuthedData 객체를 반환합니다.
4. HttpRequestAuthedData: 서명된 요청에 대한 정보를 가져옵니다.
5. GlideHTTPRequest: 서명된 요청을 보냅니다.
{#AuthCredentialAPI__ol_gvv_22t_tjb}

이러한 API를 사용하기 전에 요청에 서명하고 요청을 인증하는 데 사용되는 자격 증명과 연결하도록 [인증 알고리즘을 구성](https://www.servicenow.com/docs/access?context=configure-authentication-algorithm&version=australia&pubname=australia-platform-security&ft:locale=en-US) 해야 합니다.

빈 AuthCredential 객체를 생성하거나, 기존 AuthCredential 객체를 인스턴스화하거나, StandardCredentialsProvider 클래스를 사용하여 자격 증명 \[discovery_credentials\] 테이블의 자격 증명 레코드를 사용하여 AuthCredential 객체를 인스턴스화할 수 있습니다. 빈 AuthCredential 객체를 생성하는 경우 setAttribute() 메서드를 사용하여 객체에 속성을 추가합니다. {#AuthCredentialAPI__p_mpf_pjx_zjb}  
다음 예제에서는 StandardCredentialsProvider를 사용하여 AuthCredential을 인스턴스화하는 방법을 보여줍니다.

    // Return an AuthCredential object using a Credential sys_id
    var credential = new sn_cc.StandardCredentialsProvider().getAuthCredentialByID("5b61c16f73533300f662cff8faf6a74b");

`sn_auth` 네임스페이스 식별자를 사용하여 범위가 지정된 스크립트에서 AuthCredential API를 사용합니다.

## AuthCredential - AuthCredential(개체: authCredential) {#ariaid-title2}

새 AuthCredential 개체를 인스턴스화하거나 기존 개체를 수정합니다.
빈 AuthCredential 객체를 생성하거나, 기존 AuthCredential 객체를 인스턴스화하거나, StandardCredentialsProvider 클래스를 사용하여 자격 증명 \[discovery_credentials\] 테이블의 자격 증명 레코드를 사용하여 AuthCredential 객체를 인스턴스화할 수 있습니다. 빈 AuthCredential 객체를 생성하는 경우 setAttribute() 메서드를 사용하여 객체에 속성을 추가합니다.
{#AuthCredential-AuthCredential_O__table_sjv_2sx_5jb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 인증 자격 증명 | 객체 | 옵션입니다. 기존 AuthCredential 개체를 업데이트하려면 이 매개변수를 포함합니다. |
[표 1. 매개변수]

{#AuthCredential-AuthCredential_O__table_sjv_2sx_5jb}

## AuthCredential - getAttribute(문자열 키) {#ariaid-title3}

AuthCredential 속성의 값을 반환합니다.
{#AuthCredential-getAttribute_S__table_ss5_hsx_5jb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 키 | 문자열 | 값을 반환할 속성의 키입니다. 빈 AuthCredential 객체를 만든 경우 setAttribute() 메서드를 사용하여 객체에 속성을 추가해야 합니다. 자격 증명 기록을 사용하여 AuthCredential 객체를 인스턴스화한 경우 자격 증명 \[discovery_credentials\] 테이블의 필드 이름을 전달하여 값에 액세스합니다. |
[표 2. 매개변수]

{#AuthCredential-getAttribute_S__table_ss5_hsx_5jb} {#AuthCredential-getAttribute_S__table_ts5_hsx_5jb__entry__2}

| 유형 | 설명 |
|-|-|
| 무효 |   |
[표 3. 반환]

{#AuthCredential-getAttribute_S__table_ts5_hsx_5jb}  

    // Define the HttpRequestData object
    var endpoint= "https://third-party-endpoint";
    var httpRequestData = new sn_auth.HttpRequestData();
    httpRequestData.setEndpoint(endpoint);
    httpRequestData.setService('s3');
    httpRequestData.setRegion('us-east-1');
    httpRequestData.setHttpMethod("PUT");
    var content = "Action=SendMessage&MessageBody=This is a test message";
    httpRequestData.setContent(content);
    httpRequestData.addHeader('x-amz-acl', 'public-read' );
     
    // Get AuthCredential object and set an attribute
    var credential = new sn_auth.AuthCredential();
    credential.setAttribute("user_name", "admin");
     
    // Sign the request and return an AuthCredential attribute value
    var signingAPI = new sn_auth.RequestAuthAPI(httpRequestData, credential);
    var signingCredential = signingAPI.getAuthCredential();
    name = signingCredential.getAttribute("name");

## AuthCredential - setAttribute(문자열 키, 문자열 값) {#ariaid-title4}

AuthCredential 개체의 속성을 설정합니다.
{#AuthCredential-setAttribute_S_S__table_off_jsx_5jb__entry__3}

| 이름 | 유형 | 설명 |
|-|-|-|
| 키 | 문자열 | 설정할 속성의 이름입니다. 빈 AuthCredential 객체를 만든 경우 이 메서드를 사용하여 객체에 속성을 추가해야 합니다. 자격 증명 기록을 사용하여 AuthCredential 객체를 인스턴스화한 경우 자격 증명 \[discovery_credentials\] 테이블의 필드 이름을 전달하여 값을 설정합니다. |
| 값 | 문자열 | 속성의 값입니다. |
[표 4. 매개변수]

{#AuthCredential-setAttribute_S_S__table_off_jsx_5jb} {#AuthCredential-setAttribute_S_S__table_pff_jsx_5jb__entry__2}

| 유형 | 설명 |
|-|-|
| 무효 |   |
[표 5. 반환]

{#AuthCredential-setAttribute_S_S__table_pff_jsx_5jb}  

    // Define the HttpRequestData object
    var endpoint= "https://third-party-endpoint";
    var httpRequestData = new sn_auth.HttpRequestData();
    httpRequestData.setEndpoint(endpoint);
    httpRequestData.setService('s3');
    httpRequestData.setRegion('us-east-1');
    httpRequestData.setHttpMethod("PUT");
    var content = "Action=SendMessage&MessageBody=This is a test message";
    httpRequestData.setContent(content);
    httpRequestData.addHeader('x-amz-acl' , 'public-read' );
     
    // Get AuthCredential object and set an attribute
    var credential = new sn_auth.AuthCredential();
    credential.setAttribute("user_name", "admin");


