์ด ํ์ด์ง์์๋ SAML(๋ณด์ ๋ณด์ฅ ๋งํฌ์ ์ธ์ด) ์์ฑ ์ ํ๋ฅผ ํ์ฑํํ๊ณ ์ฌ์ฉํ๋ ๋ฐฉ๋ฒ์ ๋ํด ์ค๋ช ํฉ๋๋ค. ์ด ๊ธฐ๋ฅ์ ์ฌ์ฉํ๋ฉด ID ๊ณต๊ธ์ ์ฒด์ SAML ์์ฑ์ IAP(Identity-Aware Proxy)๋ก ๋ณดํธ๋๋ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ํํ ์ ์์ต๋๋ค. SAML ์์ฑ์ ์ ํํ ๋, ์ ํํ ์์ฑ๊ณผ ์ ํํ ๋ฐฉ๋ฒ์ ์ง์ ํ ์ ์์ต๋๋ค.
์์ํ๊ธฐ ์ ์
SAML V2.0 ์ด์ค์ ๋ฐ ํ๋กํ ์ฝ ์ฌ์ (PDF)์ ๊ดํด ์ ์๊ณ ์์ด์ผ ํฉ๋๋ค.
๋ฐ์ดํฐ๊ฐ ์ฒ๋ฆฌ๋๋ ๋ฐฉ์ ์ดํด
SAML ์์ฑ ์ ํ๋ฅผ ์ฌ์ฉ ์ค์ ํ๊ธฐ ์ ์Google Cloud ๊ฐ ๋ฐ์ดํฐ๋ฅผ ๊ด๋ฆฌํ๋ ๋ฐฉ๋ฒ๊ณผ ์ด ์ฑ๋์ ํตํด ์ ๋ฌํ๊ฑฐ๋ ์ ๋ฌํด์๋ ์ ๋๋ ์ ๋ณด ์ ํ์ ์ดํดํด์ผ ํฉ๋๋ค.
IAP๊ฐ ๋ณดํธ๋ ์ ํ๋ฆฌ์ผ์ด์
์ ์ ๊ณตํ๋ ์ ๋ณด์ ํ๋ ์ด์์ ์์ฑ์ ํฌํจํ๋๋ก IAP๋ฅผ ๊ตฌ์ฑํ ์ ์์ต๋๋ค. ์๋ ํํฐ ID ๊ณต๊ธ์
์ฒด๋ฅผ ํตํด SSO๋ฅผ ์ค์ ํ๊ณ ID ๊ณต๊ธ์
์ฒด๊ฐ SAML ์ด์ค์
์ <AttributeStatement>
๋ฅผ ํฌํจํ๋ ๊ฒฝ์ฐGoogle Cloud ๋ ์ฌ์ฉ์์ Google ๊ณ์ ์ธ์
์ ์ฐ๊ฒฐ๋ ์์ฑ์ ์์ ์ ์ฅํฉ๋๋ค. Google ๊ณ์ ์ธ์
์ด ๋ง๋ฃ๋๋ฉด ๋น๋๊ธฐ ํ๋ก์ธ์ค๋ ์ผ์ฃผ์ผ ๋ด์ ์ ๋ณด๋ฅผ ์๊ตฌ์ ์ผ๋ก ์ญ์ ํฉ๋๋ค. ๋ง๋ฃ์ผ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค.
๊ณ์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด, ์ฃผ๋ฏผ๋ฑ๋ก๋ฒํธ, ์นด๋ ์์ง์ ๋ฐ์ดํฐ, ๊ธ์ต ๊ณ์ ๋ฐ์ดํฐ, ์๋ฃ ์ ๋ณด, ๋ฏผ๊ฐํ ๋ฐฐ๊ฒฝ ์ ๋ณด์ ๊ฐ์ ๋ฏผ๊ฐํ ๊ฐ์ธ ์๋ณ ์ ๋ณด(PII)์๋ SAML ์์ฑ ์ ํ๋ฅผ ์ฌ์ฉํ์ง ๋ง์ธ์.
SAML ์์ฑ ์ ํ ์ฌ์ฉ ์ค์
Google Workspace์์ SSO ํ๋กํ์ ๋ง๋ค์ด SAML ์์ฑ ์ ํ๋ฅผ ์ฌ์ฉ ์ค์ ํ ๋ค์ Google Cloud CLI ๋๋ REST API๋ฅผ ์ฌ์ฉํ์ฌ IAP ์ค์ ์ ์ ๋ฐ์ดํธํฉ๋๋ค.
์ฝ์
- Google Cloud Console์์ IAP ํ์ด์ง๋ก ์ด๋ํฉ๋๋ค.
IAP๋ก ์ด๋ - ๋ฆฌ์์ค ์ค์ ์ ์ด๊ณ ์์ฑ ์ ํ๋ก ์คํฌ๋กคํฉ๋๋ค.
- ์์ฑ ์ ํ ์ฌ์ฉ ์ค์ ์ ์ ํํ ๋ค์ ์ ์ฅ์ ํด๋ฆญํฉ๋๋ค.
SAML ์์ฑ ํญ์์ ๋ค์ ํ์์ ์ฌ์ฉํ์ฌ ์ ํํ๋ ค๋ ์์ฑ์ ์ ๋ ฅํฉ๋๋ค.
attribute1, attribute2, attribute3
์ปค์คํ ํํ์์ ์ฌ์ฉํ์ฌ ์์ฑ์ ์ ๋ ฅํ ์๋ ์์ต๋๋ค. ์ปค์คํ ํํ์์ ์์ฑ์ SAML ์์ฑ ํญ์ ํ์๋ฉ๋๋ค. SAML ์์ฑ ํญ์ ์์ฑ์ด ํ์๋๋ ค๋ฉด ๋ค์ ํํ ํ์์ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
attributes.saml_attributes.filter(attribute, attribute.name in ['attribute', 'attribute2', 'attribute1'])
์ ๋ฌํ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ์ ํ์ ๊ฒฝ์ฐ IdP์์ ์์ ๋๋ ์์ฑ ํ์์ ํ๋ ์ด์ ์ ํํ์ฌ ์ ํ๋ฆฌ์ผ์ด์ ์ ์ ๋ฌํฉ๋๋ค.
gcloud
๋ค์ IAP gcloud CLI ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ SAML ์์ฑ ์ ํ ์ค์ ์ ์ ๋ฐ์ดํธํ์ธ์.
gcloud iap settings set SETTING_FILE [--folder=FOLDER --organization=ORGANIZATION --project=PROJECT> --resource-type=RESOURCE_TYPE --service=SERVICE --version=VERSION] [GCLOUD_WIDE_FLAG โฆ]
๋ค์์ ๋ฐ๊ฟ๋๋ค.
- FOLDER: ์ ํ๋ฆฌ์ผ์ด์ ์ด ์๋ ํด๋
- ORGANIZATION: ์ ํ๋ฆฌ์ผ์ด์ ์ด ์๋ ์กฐ์ง
- PROJECT: ์ ํ๋ฆฌ์ผ์ด์ ์ด ์๋ ํ๋ก์ ํธ
- RESOURCE_TYPE: ๋ฆฌ์์ค ์ ํ
- SERVICE: ์๋น์ค
- VERSION: ๋ฒ์ ๋ฒํธ์ ๋๋ค.
YAML:
applicationSettings: attributePropagationSettings: expression: CEL_EXPRESSION outputCredentials: ARRAY[OUTPUT_CREDENTIALS] enable: BOOLEAN
JSON:
{ "application_settings":{ "attribute_propagation_settings": { "expression": CEL_EXPRESSION, "output_credentials": ARRAY[OUTPUT_CREDENTIALS] "enable": BOOLEAN } } }
REST API
๋ค์ ์์์ ๊ฐ์ด IapSettings์์ ApplicationSettings
๊ฐ์ฒด๋ฅผ ์ฌ์ฉํ์ฌ ์ ํํ๋๋ก SAML ์์ฑ์ ๊ตฌ์ฑํ ์ ์์ต๋๋ค.
{ "csmSettings": { object (CsmSettings) }, "accessDeniedPageSettings": { object (AccessDeniedPageSettings) }, "attributePropagationSettings": { object (AttributePropagationSettings) }, "cookieDomain": string, }
AttributePropagationSettings
{ "expression": string, "output_credentials": array "enable": boolean }
์ถ๋ ฅ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด ์ค์
SAML ์์ฑ ์ ํ๋ฅผ ์ฌ์ฉํ๋ฉด ์ถ๋ ฅ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ์ฌ JSON ์น ํ ํฐ(JWT) ๋ฐ ํค๋๋ฅผ ํฌํจํ ์ฌ๋ฌ ๋งค์ฒด์ ์์ฑ์ ์ ์กํ ์ ์์ต๋๋ค. API์์ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ฅผ ์ค์ ํ๋ ค๋ฉด ๋ค์ ์์ ๊ฐ์ด ์ผํ๋ก ๊ตฌ๋ถ๋ ๋ฌธ์์ด ๋ชฉ๋ก์ ์ง์ ํ๋ฉด ๋ฉ๋๋ค.
"output_credentials": ["HEADER", "JWT", "RCTOKEN"]
Common Expression Language๋ฅผ ์ฌ์ฉํ์ฌ SAML ์์ฑ ํํฐ๋ง
Common Expression Language(CEL) ํจ์๋ฅผ ์ฌ์ฉํ์ฌ SAML ์์ฑ์ ํํฐ๋งํ ์ ์์ต๋๋ค.
SAML ์์ฑ ์ ํ๋ก CEL ํํ์์ ์ฌ์ฉํ ๋ ๋ค์๊ณผ ๊ฐ์ ์ ํ์ฌํญ์ด ์์ต๋๋ค.
- ํํ์์ ์์ฑ ๋ชฉ๋ก์ ๋ฐํํด์ผ ํฉ๋๋ค.
- ํํ์์์ ์์ฑ์ ์ต๋ 45๊ฐ๊น์ง ์ ํํ ์ ์์ต๋๋ค.
- ํํ์ ๋ฌธ์์ด์ 1,000์(์๋ฌธ ๊ธฐ์ค)๋ฅผ ์ด๊ณผํ ์ ์์ต๋๋ค.
๋ค์์ IAP SAML ์์ฑ ์ ํ ๊ธฐ๋ฅ์ ์ฌ์ฉํ ๋ ์ง์๋๋ CEL ํจ์์ ๋๋ค.
ํจ์๋ ๋์๋ฌธ์๋ฅผ ๊ตฌ๋ถํ๋ฉฐ ์์ฑ๋ ๊ทธ๋๋ก ์ฌ์ฉ๋์ด์ผ ํฉ๋๋ค. ํจ์ ํธ์ถ์ ์ฐ๊ฒฐํ ๋ strict
๋ฐ emitAs
ํจ์์ ์์๋ ์ค์ํ์ง ์์ต๋๋ค.
ํจ์ | ์ | ์ค๋ช |
---|---|---|
ํ๋ ์ ํ | a.b |
proto a ์์ ํ๋ b ๋ฅผ ์ ํํฉ๋๋ค. b ๋ฌธ์๋ ๋ค๋ฅธ proto, ๋ชฉ๋ก ์๋๋ฉด ๋ฌธ์์ด๊ณผ ๊ฐ์ ๊ฐ๋จํ ๊ฐ ์ ํ์ผ ์ ์์ต๋๋ค. |
๋ชฉ๋ก ํํฐ๋ง | list.Filter(iter_var, condition) |
ํญ๋ชฉ์ด condition ์ ์ถฉ์กฑํ๋ list ํ์ ์งํฉ์ ๋ฐํํฉ๋๋ค. |
๋ชฉ๋ก ๋ฉค๋ฒ์ญ | b ์ ๋ํด a |
a ๊ฐ์ด b ๋ชฉ๋ก์ ๊ตฌ์ฑ์์ธ ๊ฒฝ์ฐ true ๋ฅผ ๋ฐํํฉ๋๋ค. |
selectByName | list.selectByName("name") |
๋ชฉ๋ก์์ name = "name" ์ธ ์์ฑ์ ์ ํํฉ๋๋ค. |
append | list.append(attribute) |
์ง์ ๋ ์์ฑ์ ์ง์ ๋ ๋ชฉ๋ก์ ์ถ๊ฐํฉ๋๋ค. |
strict | attribute.strict() |
HEADERS ๋ฅผ ์ถ๋ ฅ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ x-goog-iap-attr- ํ๋ฆฌํฝ์ค ์์ด ์์ฑ์ ๋ด๋ณด๋
๋๋ค. |
emitAs | attribute.emitAs("new_name") |
์ด๋ฆ์ด "new_name" ์ธ ์ง์ ๋ ์์ฑ์ ์ ํํ ๋ชจ๋ ์ถ๋ ฅ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด์ ์ถ๋ ฅํฉ๋๋ค. |
CEL ํํ์ ์์
SAML ์ด์ค์ ์ ๊ฐ์ ํฉ๋๋ค.
<saml2:AttributeStatement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<saml2:Attribute Name="my_saml_attr_1">
<saml2:AttributeValue xsi:type="xsd:string">value_1</saml2:AttributeValue>
<saml2:AttributeValue xsi:type="xsd:string">value_2</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="my_saml_attr_2">
<saml2:AttributeValue xsi:type="xsd:string">value_3</saml2:AttributeValue>
<saml2:AttributeValue xsi:type="xsd:string">value_4</saml2:AttributeValue>
</saml2:Attribute>
<saml2:Attribute Name="my_saml_attr_3">
<saml2:AttributeValue xsi:type="xsd:string">value_5</saml2:AttributeValue>
<saml2:AttributeValue xsi:type="xsd:string">value_6</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
my_saml_attr_1
์ ์ ํํ๋ ค๋ฉด ๋ค์ CEL ํํ์์ ์ฌ์ฉํ์ธ์.
attributes.saml_attributes.filter(attribute, attribute.name in ["my_saml_attr_1"])
my_saml_attr_1
๋ฐ my_saml_attr_2
๋ฅผ ์ ํํ๋ ค๋ฉด ๋ค์ CEL ํํ์์ ์ฌ์ฉํฉ๋๋ค.
attributes.saml_attributes.filter(attribute, attribute.name in ["my_saml_attr_1", "my_saml_attr_2"])
์์ฑ ํ์
์ ํํ ๋ชจ๋ ์์ฑ์ด ์ ํํ ๋ชจ๋ ์ถ๋ ฅ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด์ ์์ ํ ๋ณต์ ๋ฉ๋๋ค.
์: SAML ์ด์ค์ ๊ฐ์
<saml2:AttributeStatement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<saml2:Attribute Name="my_saml_attr_1">
<saml2:AttributeValue xsi:type="xsd:string">value_1</saml2:AttributeValue>
<saml2:AttributeValue xsi:type="xsd:string">value_2</saml2:AttributeValue>
</saml2:Attribute>
</saml2:AttributeStatement>
JWT ๋ฐ RC ํ ํฐ
JWT ํ ํฐ์ additional_claims
ํ๋๋ฅผ ํตํด ์์ฑ์ ์ ๊ณตํฉ๋๋ค. ํ๋๋ ๊ฐ์ฒด์ด๋ฉฐ ์์ฑ ๊ฐ ๋ชฉ๋ก์ ๋ํ ์์ฑ ์ด๋ฆ ๋งคํ์ ํฌํจํฉ๋๋ค. ์์ฑ ์ด๋ฆ์ ์ ๊ณต๋ SAML ์ด์ค์
์์ ๋ณ๊ฒฝ๋์ง ์์ต๋๋ค.
์์ SAML ์ด์ค์ ์ ๊ฒฝ์ฐ IAP JWT์๋ ๋ค์์ด ํฌํจ๋ฉ๋๋ค.
{
"additional_claims": {
"my_saml_attr_1": ["value_1", "value_2"]
}
}
SAML ์ด์ค์ ์ ํค๋
ํค๋์์ ์์ฑ, ํค, ์ด๋ฆ ๊ฐ์ RFC 3986์ ๋ฐ๋ผ URL ์ด์ค์ผ์ดํ ์ฒ๋ฆฌ๋๋ฉฐ ์ผํ๋ก ์กฐ์ธ๋ฉ๋๋ค. ์๋ฅผ ๋ค์ด header&name: header$value
๋ x-goog-iap-attr-header%26name: header%24value
๊ฐ ๋ฉ๋๋ค.
IAP ํค๋๋ฅผ ๊ณ ์ ํ๊ฒ ์๋ณํ๊ธฐ ์ํด ๊ฐ ํค๋์๋ IAP ํ๋ฆฌํฝ์ค x-goog-iap-attr-
์ด ํฌํจ๋ฉ๋๋ค. ๋ณด์์์ ์ด์ ๋ก ๋ถํ ๋ถ์ฐ๊ธฐ๋ x-goog-iap-attr
ํ๋ฆฌํฝ์ค๊ฐ ์๋ ๋ชจ๋ ์์ฒญ ํค๋๋ฅผ ์ญ์ ํฉ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ์ฑ์์ ์์ ํ ํค๋๊ฐ IAP์์ ์์ฑ๋ฉ๋๋ค.
์์ SAML ์ด์ค์ ์ ํค๋๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
"x-goog-iap-attr-my_saml_attr_1": "value_1,value_2"
๋ค์ ์์์์๋ value&1
, value$2
, value,3
๊ณผ ๊ฐ์ ํค๋์์ ์์ฑ์ ์ ํํ ๋ IAP๊ฐ ํน์ ๋ฌธ์๋ฅผ ์ด์ค์ผ์ดํ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
"x-goog-iap-attr-my_saml_attr_1": "value%261,value%242,value%2C3"
๋ค์์ ํค๋ ์ด๋ฆ์ด ์ด์ค์ผ์ดํ๋๋ ๋ฐฉ๋ฒ์ ์์ ๋๋ค.
ํค๋ ์ด๋ฆ:
"iap,test,3": "iap_test3_value1,iap_test3_value2"
์ด์ค์ผ์ดํ ์ฒ๋ฆฌ๋ ํค๋ ์ด๋ฆ:
"X-Goog-IAP-Attr-iap%2Ctest%2C3": "iap_test3_value1,iap_test3_value2"
์์ฑ ๋ง์ถค์ค์
selectByName
, append
, strict
, emitas
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ ํ๋ ์์ฑ ์ด๋ฆ์ ์์ ํ๊ณ ์ผ๋ถ ์์ฑ์ ํค๋ ํ๋ฆฌํฝ์ค๋ฅผ ์ฌ์ฉํ ์ง ์ฌ๋ถ๋ฅผ ์ง์ ํ ํ ์ IAP ์ ๊ณต ์์ฑ์ ์ ํํ ์ ์์ต๋๋ค.
SAML ์์ฑ ์ ํ๋ ํ์ ์์ง๋ง SM_USER ํ๋์ ์ด๋ฉ์ผ ์ฃผ์, ๊ธฐ๊ธฐ ID ๋๋ ํ์์คํฌํ๊ฐ ํ์ํ ๊ฒฝ์ฐ iap_attributes list
: attributes.iap_attributes
โฆ์์ ์ด๋ฌํ ์์ฑ์ ์ ํํ ์ ์์ต๋๋ค.
IAP๋ user_email
, device_id
, timestamp
์์ฑ์ ์ ๊ณตํฉ๋๋ค.
์์
๋ค์ ์์์์๋ selectByName
, append
, strict
, emitas
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ์ ๋ง์ถค์ค์ ํ๋ ๋ฐฉ๋ฒ์ ๋ณด์ฌ์ค๋๋ค.
์์ SAML ์ด์ค์ ์ ๊ฐ์ ํฉ๋๋ค.
selectByName
selectByName
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์ฃผ์ด์ง ๋ชฉ๋ก์์ ์ด๋ฆ๋ณ๋ก ๋จ์ผ ์์ฑ์ ์ ํํฉ๋๋ค. ์๋ฅผ ๋ค์ด my_saml_attr_1
์ ์ ํํ๋ ค๋ฉด ๋ค์ ํํ์์ ์ฌ์ฉํฉ๋๋ค.
attributes.saml_attributes.selectByName("my_saml_attr_1")
append
append
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ ๋ชฉ๋ก์ ์์ฑ์ ์ถ๊ฐํฉ๋๋ค. ์ง์๋๋ IAP ์์ฑ ๋ชฉ๋ก ์ค ํ๋์์ ์ด ์์ฑ์ ์ ํํด์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด my_saml_attr_1
์ด ํฌํจ๋ ๋ชฉ๋ก์ my_saml_attr_2
๋ฅผ ์ถ๊ฐํ๋ ค๋ฉด ๋ค์ ํํ์์ ์ฌ์ฉํฉ๋๋ค.
attributes.saml_attributes.filter(x, x.name in ["my_saml_attr_1"]).append(attributes.saml_attributes.selectByName("my_saml_attr_2"))
"my_saml_attr_2"
๋ฅผ ํํฐ ๋ชฉ๋ก์ ์ถ๊ฐํ ์ ์์ต๋๋ค. ๋ค์๊ณผ ๊ฐ์ด ์ฐ๊ฒฐ์ ์ฐ๊ฒฐํ์ฌ ์์ฑ ์ฌ๋ฌ ๊ฐ๋ฅผ ์ถ๊ฐํ๊ณ ๋ชฉ๋ก์ ์ถ๊ฐํ ์๋ ์์ต๋๋ค.
attributes.saml_attributes.filter(x, x.name in ["my_saml_attr_1"]).append(
attributes.saml_attributes.selectByName("my_saml_attr_2")).append(
attributes.saml_attributes.selectByName("my_saml_attr_3"))
๋จ์ผ ์์ฑ ์ถ๊ฐ๋ strict
๋ฐ emitAs
๊ธฐ๋ฅ๊ณผ ํจ๊ป ์ฌ์ฉํ ๋ ๊ฐ์ฅ ์ ์ฉํฉ๋๋ค.
strict
IAP์์ x-goog-iap-attr-
ํ๋ฆฌํฝ์ค๋ฅผ ์ด๋ฆ์ ์ถ๊ฐํ์ง ์๋๋ก strict
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ์ ํ๋๊ทธ๋ฅผ ์ง์ ํฉ๋๋ค. ์ด๋ ๋ฐฑ์๋ ์ ํ๋ฆฌ์ผ์ด์
์ ์์ฑ ์ด๋ฆ์ด ์ ํํด์ผ ํ๋ ๊ฒฝ์ฐ์ ์ ์ฉํฉ๋๋ค. ์๋ฅผ ๋ค๋ฉด ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
attributes.saml_attributes.selectByName("my_saml_attr_1").strict()
emitAs
emitAs
ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ์ ์ ์ด๋ฆ์ ์ง์ ํฉ๋๋ค. ์ง์ ํ ์ด๋ฆ์ด ๋ชจ๋ ์ฌ์ฉ์ ์ธ์ฆ ์ ๋ณด์ ์ถ๋ ฅ๋ฉ๋๋ค. ์๋ฅผ ๋ค์ด my_saml_attr_1
์ custom_name
์ผ๋ก ๋ฐ๊พธ๋ ค๋ฉด ๋ค์ ํํ์์ ์ฌ์ฉํฉ๋๋ค.
attributes.saml_attributes.selectByName("my_saml_attr_1").emitAs("custom_name")
๋ค์ํ ํจ์๋ฅผ ์ฌ์ฉํ์ฌ ํน์ ์ฌ์ฉ ์ฌ๋ก์ ๋ง๊ฒ ์์ฑ์ ๋ง์ถค์ค์ ํ ์ ์์ต๋๋ค. ์๋ฅผ ๋ค์ด ๋ค์ ํํ์์ ์ฌ์ฉํ์ฌ IAP ์์ฑ์์ ๋ค๋ฅธ SAML ์์ฑ๊ณผ ํจ๊ป ์ฌ์ฉ์์ ์ด๋ฉ์ผ์ "SM_USER"
๋ก ์ ํํ ์ ์์ต๋๋ค.
attributes.saml_attributes.filter(x, x.name in ["my_saml_attr_1"]).append(
attributes.iap_attributes.selectByName("user_email").emitAs("SM_USER").strict())
์ถ๋ ฅ ํค๋๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
"x-goog-iap-attr-my_saml_attr_1": "value_1,value_2"
"SM_USER": "email@domain.com"
SAML ์์ฑ ์ ํ ์ฌ์ฉ ์ ์ ์ฝ์กฐ๊ฑด
๋ก๊ทธ์ธ ์, ID ๊ณต๊ธ์ ์ฒด์์ ๋ค์ด์ค๋ ์์ฑ์ SAML ์์ฑ ๋ฐ์ดํฐ๋ 2KB๋ก ์ ํ๋ฉ๋๋ค. 2KB ํ๋๋ฅผ ์ด๊ณผํ๋ ์ด์ค์ ์ ๊ฑฐ๋ถ๋๊ณ ๋ก๊ทธ์ธ์ ์คํจํฉ๋๋ค.
๋๋ถ๋ถ์ ์น ์๋ฒ๋ ์์ฒญ ํฌ๊ธฐ ํ๋๊ฐ 8KB์ ๋๋ค. ์ด๋ ๊ฒ ํ๋ฉด ํค๋์ ์ค๋ณต ์์ฑ์ ๋น๋กฏํ์ฌ ๋ฐ์ ์ปค์คํ ์์ฑ์ ํฌ๊ธฐ๊ฐ ์ ํ๋ฉ๋๋ค. ์ด๋ฆ์ ๊ฐ์ด ์ถ๊ฐ๋ ์์ฑ์ด ๋ณต์ ๋ฐ ์ธ์ฝ๋ฉ๋์์ ๋ ํฌ๊ธฐ๊ฐ 5,000๋ฐ์ดํธ๋ฅผ ์ด๊ณผํ๋ฉด IAP๊ฐ ์์ฒญ์ ๊ฑฐ๋ถํ๊ณ IAP ์ค๋ฅ ์ฝ๋ 401์ ๋ฐํํฉ๋๋ค.
SAML ์์ฑ ์ ํ์ ์ ๋์ฝ๋ ๋ฌธ์
์ด ๊ธฐ๋ฅ์ ์ ๋์ฝ๋ ๋ฐ UTF-8 ๋ฌธ์๋ฅผ ์ง์ํ์ง ์์ผ๋ฏ๋ก ์์ฑ ๊ฐ์ ํ์ ASCII ๋ฌธ์์ด์ด์ด์ผ ํฉ๋๋ค. ์ด์ค์ ์ด ํ์ ASCII๊ฐ ์๋ ๊ฒฝ์ฐ ๋ก๊ทธ์ธ์ ์คํจํฉ๋๋ค.