認証の例のコード
以下は、認証の例のコードです。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
}
}