---
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


---

# 리디렉션 및 쿠키로 ASP.NET

# C를 사용한 샘플 ASP.NET 쿠키로 샤프 리디렉션 {#ariaid-title1}

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

이 샘플 ASP.NET 코드는 간단한 인증 포털을 만들고 암호화되지 않은 HTTP 헤더를 쿠키로 전달합니다.
주:  
여기에 설명된 기능에는 관리자 역할이 필요합니다. 주:  
쿠키는 도메인에 따라 다르며 다른 네트워크 도메인에서 사용할 수 없습니다. 쿠키를 읽을 수 있는 유일한 도메인은 쿠키를 설정하는 도메인입니다. 어떤 도메인 이름을 설정했는지는 중요하지 않습니다. SSO 포털이 인스턴스와 ServiceNow 동일한 네트워크 도메인에 있는 옵션이 없는 경우(예: 온프레미스 배포에서, 대안은 URL GET 또는 POST 매개변수를 사용하여 SSO 토큰을 전달하는 것입니다.

이 샘플에서는 다음을 가정합니다.

* 웹 서버는 ASP.NET 및 C를 지원합니다.#
* 대상 ServiceNow 인스턴스는 https://\<instance name\>.service-now.com/ 입니다.
* SiteMinder 또는 다른 1회 사용자 인증(SSO) 애플리케이션이 사용자를 사전 인증했습니다.
* 대상 ServiceNow 인스턴스에는 SM_USER의 HTTP 헤더가 필요합니다.

ASP 코드를 변경하여 사용자를 적절한 ServiceNow 인스턴스로 리디렉션합니다.  

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title>Portal Page Login</title>
    <%--    <meta http-equiv="REFRESH" content="0;url=https://<instance name>.service-now.com/">--%>
     
    </head>
    <body>
        <form id="form1" runat="server">
        <h2><b> Portal Page Login </b></h2>
            <hr style="position: static" />
             <br />
             <asp:Label ID="Label2" runat="server" Font-Size="Larger" Height="21px" Style="position: static"
                Text="Instance URL:" Width="113px"></asp:Label> 
            <asp:TextBox ID="urlBox" runat="server" Font-Size="Large" Style="position: static"></asp:TextBox><br />
            <br />
             <asp:Label ID="Label1" runat="server" Font-Size="Larger" Height="17px" Style="position: static;" Text="User Id:" Width="113px"></asp:Label> 
            <asp:TextBox ID="userNameBox" runat="server" Font-Size="Large" Style="position: static;"></asp:TextBox>
     
            <br />
            <br />
            <asp:Button ID="Button1" runat="server" Height="39px" Style="position: static;" Text="Ok"
                Width="88px" OnClick="Button1_click" />
        </form>
    </body>
    </html>
    </asp>

다음 C# 코드는 양식에 대한 OnClick 단추 이벤트를 처리합니다. 코드:

* 쿠키 "SM_USER"을 만듭니다.
* ASP 양식에 지정된 URL로 리디렉션을 수행합니다.

C# 코드를 변경하여 적절한 쿠키 이름을 만듭니다.  

    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
     
    public partial class _Default : System.Web.UI.Page 
    {
        protected void Page_Load(object sender, EventArgs e)
        {
     
        }
        protected void Button1_click(object sender, EventArgs e)
        {
            try
            {
                HttpCookie myCookie = new HttpCookie("SM_USER");
                myCookie.Value = userNameBox.Text;
                Response.Cookies.Add(myCookie);
                Response.Redirect(urlBox.Text);
     
            }catch {} 
        }
    }


