Skip to main content

This documentation is for an older version of this product. See the latest version of this content.Opens in a new tab

認証の例のコード

以下は、認証の例のコードです。IDE を使用してクラスを作成します。


Class SecurityTutorial.AuthenticationExample Extends %CSP.REST
{
XData UrlMap 
{
    <Routes>
        <Route Url="/authenticationEx" Method="Get" Call="authenticationEx"/>

    </Routes>
}

ClassMethod authenticationEx() As %Status 
{
      
    Set %response.Status = ..#HTTP200OK
    
    Set obj={
    
        "username":($UserName),
        "roles":($Roles)
    }
    
    Write obj.%ToJSON()
    
    Return $$$OK
}
}
FeedbackOpens in a new tab