isam 驱动程序 下载_将ISAM反向代理配置为与OpenID连接提供程序的PEP
isam 驅(qū)動程序 下載
注意:截至2017年5月9日,“執(zhí)行測試流程”部分(在“步驟2.將反向代理配置為OpenID Connect的聯(lián)系點”部分中)下的代碼已更新。
IBM Security Access Manager(ISAM)在9.0版中添加了OpenID Connect(OIDC)作為聯(lián)合協(xié)議。 OIDC包含配置OpenID Provider(OP)的功能,該功能可以發(fā)布用戶身份(id_tokens)以及用于身份驗證的訪問令牌,其方式與OAuth 2.0版相同。 反向代理可以使用OAuth訪問令牌作為策略執(zhí)行點(PEP),可以通過使用此處定義的WS-Trust接口來實現(xiàn)。 傳統(tǒng)上,此接口與用于移動API保護定義的ISAM一起使用,但是它與作為OpenID Connect流的一部分發(fā)行的訪問令牌不兼容。 本文介紹了如何將反向代理配置為與OpenID Connect頒發(fā)的訪問令牌兼容的策略執(zhí)行點。
需要執(zhí)行以下步驟:
“在本文中,我將演示如何將反向代理配置為與OpenID Connect提供程序發(fā)出的訪問令牌兼容的策略執(zhí)行點。 ”
ISAM上的OpenID Connect提供程序是一個聯(lián)盟,每組依賴方憑據(jù)都是合作伙伴。 在下面描述的過程中,配置了一個OP聯(lián)合并創(chuàng)建了兩個伙伴。 一個代表依賴方實體,另一個代表反向代理/安全令牌服務(wù)在充當(dāng)PEP時使用。
注意:本文中的 “反向代理”始終指的是ISAM反向代理。
步驟1.配置OP聯(lián)合
可以在聯(lián)盟用戶界面(UI)之外或通過REST API調(diào)用來配置和管理聯(lián)盟。 聯(lián)合身份驗證用戶界面位于“ 安全:聯(lián)合身份 > 聯(lián)合身份”下 。 如果您使用的是REST服務(wù),請參閱Web服務(wù)文檔(轉(zhuǎn)到Secure:聯(lián)合 > 聯(lián)合 > 創(chuàng)建新的聯(lián)合 ),以獲取有關(guān)如何調(diào)用聯(lián)合REST API和要提供的屬性的說明。
通過用戶界面配置聯(lián)盟
通過REST配置聯(lián)盟
使用以下代碼創(chuàng)建聯(lián)盟:
POST_DATA=' {"name": "acmeProvider","protocol": "OIDC","role": "op","configuration": {"providerId": "acmeProvider","issuerIdentifier": "https://acmeProvider.com","signatureAlgorithm": "HS256","authorizationCodeLength": 30,"refreshTokenLength": 50,"accessTokenLength": 40,"authorizationCodeLifetime": 30,"accessTokenLifetime": 7200,"authorizationGrantLifetime": 604800,"idTokenLifetime": 7200,"grantTypesSupported": ["authorization_code","implicit","refresh_token"],"identityMapping": {"activeDelegateId": "default-map","properties": {"identityMappingRuleReference": "5"}}} }'curl -k -vvv --user $USER:$PASSWORD -H 'Content-Type: application/json' \ -H 'Accept: application/json' https://$HOST/iam/access/v8/federations/ -d "$POST_DATA"這將返回包含此聯(lián)盟的UUID的位置標(biāo)頭。 要列出所有聯(lián)盟,請發(fā)出以下命令。
curl -k -vvv --user $USER:$PASSWORD -H 'Accept: application/json' \ https://$HOST/iam/access/v8/federations/$FED_UUID/partners要僅顯示一個聯(lián)合身份驗證,請將聯(lián)合身份驗證的UUID包含為路徑參數(shù):
curl -k -vvv --user $USER:$PASSWORD -H 'Accept: application/json' \ https://$HOST/iam/access/v8/federations/$FED_UUID/partners/$PARTNER_UUID注意:必須先部署未決的更改,然后才能使用此聯(lián)盟。 部署它們將觸發(fā)運行時重新啟動。
配置OP合作伙伴
OP上每個已配置的合作伙伴代表一組用于獲得授權(quán)的客戶端憑據(jù)。 這些客戶端憑據(jù)由以下組成:
- 客戶編號
- 客戶端機密(可選)
- 重定向URI
- 允許的范圍(至少必須包含openid )
可以為OP合作伙伴配置更多選項。 請參閱IBM知識中心,以獲取更多信息。
在接下來的子步驟中配置伙伴。
配置測試伙伴
注意:必須先部署未決的更改,然后才能使用此合作伙伴。 這將觸發(fā)運行時重新啟動。 要自動生成一個clientID或clientSecret ,請將其從請求中排除。 要指定一個空白的clientSecret ,請包括屬性clientSecret ,其值為“”(空字符串)。 反向代理伙伴不能使用客戶機密“”,如果伙伴正在執(zhí)行授權(quán)代碼流(如以下示例所示),則不能使用“”。
創(chuàng)建反向代理合作伙伴
要創(chuàng)建反向代理合作伙伴憑據(jù),請使用以下代碼段。 如果使用用戶界面,請確保選中“ 允許自省”選項。
POST_DATA='{"role": "op","templateName": "","configuration": {"responseTypes": ["code"],"clientId":"rpClient","clientSecret":"rpClientSecret","clientName": "Reverse proxy Client","tokenEndpointAuthMethod": "clientSecretBasic","scope": ["openid",],"allowRefreshGrant": true,"redirectUris": ["https://unused.com/"],"allowIntrospect": true},"name": "reverseProxyClient","enabled": true} 'curl -k -vvv --user $USER:$PASSWORD -H 'Content-Type: application/json' \ -H 'Accept: application/json' https://$HOST/iam/access/v8/federations/$UUID/partners -d "$POST_DATA"請務(wù)必注意, allowIntrospect設(shè)置為true。 此設(shè)置允許客戶端向/introspect端點發(fā)出請求。
步驟2.將反向代理配置為OpenID Connect的聯(lián)系點
為了利用配置的OpenID Connect Provider聯(lián)合身份,需要將反向代理配置為適當(dāng)?shù)穆?lián)系點。 本文假定使用新配置的反向代理。 有關(guān)配置反向代理的更多信息,請參閱ISAM版本9用戶文檔中的配置實例 。
配置實例后,使用聯(lián)合身份驗證自動配置Web服務(wù)適當(dāng)配置反向代理。 可以使用以下代碼段完成此操作。 要查找聯(lián)盟的UUID,請參閱上面的“ 配置OP聯(lián)合 ”。
POST_DATA=' {"runtime": {"hostname": "localhost","port": "443","username": "easuser","password": "passw0rd"},"federation_id": "'$FED_UUID'","reuse_certs": true,"reuse_acls": true } ' curl -k -vvv --user $USER:$PASSWORD -H "Accept: application/json" -H "Content-Type:application/json" \https://$HOST/wga/reverseproxy/$REVERSE_PROXY_NAME/fed_config -d "$POST_DATA"進行此調(diào)用后,請部署所有待處理的更改并重新啟動反向代理。 有關(guān)調(diào)用fed_config Web服務(wù)的更多信息,請參閱設(shè)備的Web服務(wù)文檔,位于安全:Web設(shè)置 > 管理 > 反向代理 > 聯(lián)合身份配置主題下 。
注意:必須先部署聯(lián)合身份驗證,然后才能調(diào)用聯(lián)合身份驗證配置Web服務(wù)。
創(chuàng)建一個測試用戶
使用以下命令創(chuàng)建一個用于測試的基本TAM用戶。 創(chuàng)建此用戶后,可以將屬性(例如電話號碼)添加到該用戶。 有關(guān)更多信息,請參見創(chuàng)建用戶 。
pdadmin -a sec_master -p $PASSWORD user create testuser cn=testuser,dc=iswga testuser testuser testPwd pdadmin -a sec_master -p $PASSWORD user modify testuser account-valid yes執(zhí)行測試流程
此時,應(yīng)該已經(jīng)配置了OpenID Connect提供程序聯(lián)合,伙伴和反向代理。 盡管本文沒有介紹配置任何類型的客戶端,但現(xiàn)在可以獲得授權(quán)。 下面說明如何使用Curl執(zhí)行授權(quán)代碼流。 或者,可以在瀏覽器中執(zhí)行流程的前半部分,在/token端點的授權(quán)代碼交換是通過Curl完成的。 為了啟動OpenID Connect流,通過客戶端啟動的某種方法向/authorize端點發(fā)出請求。 可以將下面的URL粘貼到瀏覽器中以檢索授權(quán)碼,也可以使用Curl。
注意:授權(quán)代碼的默認生存期為60秒。
您可以使用以下腳本執(zhí)行授權(quán)代碼流:
#!/bin/bash #hostname of the reverse proxy REVERSE_PROXY_HOSTNAME=isam-demo PROVIDER_ID=acmeProvider USERNAME=testuser #populate with testusers password PASSWORD=#populate with client credentials CLIENT_ID= CLIENT_SECRET= #state is presented at /authorize and /token STATE=someState$RANDOM$RANDOM$$ #change to a registered redirect URI. REDIR_URI=https%3A%2F%2FmyService.com%2Fredirect#initial /authorize request curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/oidc/endpoint/amapp-runtime-$PROVIDER_ID/authorize?scope=openid%20profile%20email&response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIR_URI&state=$STATE" curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/sps/amapp-runtime-$PROVIDER_ID/oidc/auth" #this returns a login form curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/sps/auth"#POST to the login form curl -b cookieJar.txt -c cookieJar.txt -v -k -d "username=$USERNAME&password=$PASSWORD&login-form-type=pwd" "https://$REVERSE_PROXY_HOSTNAME/pkmslogin.form" curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/sps/auth" curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/sps/amapp-runtime-$PROVIDER_ID/oidc/auth" #Extract the consent nonce from the consent page CONSENT=$(curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/oidc/endpoint/amapp-runtime-$PROVIDER_ID/authorize?scope=openid%20profile%20email&response_type=code&client_id=$CLIENT_ID&redirect_uri=$REDIR_URI&state=$STATE") CONSENT_NONCE=$(echo $CONSENT | grep -o -P '((?<="consentNonce":")[a-zA-Z0-9]*(?=")') #Hard coded consent decision of "yes" to openid, profile, email CODE_RSP=$(curl -b cookieJar.txt -c cookieJar.txt -v -k "https://$REVERSE_PROXY_HOSTNAME/isam/oidc/endpoint/amapp-runtime-$PROVIDER_ID/authorize" -d "consentNonce=$CONSENT_NONCE&client_id=$CLIENT_ID&response_type=code&scope=openid+profile+email&state=$STATE&redirect_uri=$REDIR_URI&prompt=consent" 2>&1) # Extract the codeCODE=$(echo $CODE_RSP | grep -o -P '(?<=code=)[^&]*') echo code: $CODE#Exchange code for an id token at /token, token does not require a cookieJar curl -k -u $CLIENT_ID:$CLIENT_SECRET https://$REVERSE_PROXY_HOSTNAME/isam/oidc/endpoint/amapp-runtime-$PROVIDER_ID/token -d "code=$CODE&grant_type=authorization_code&state=$STATE&redirect_uri=$REDIR_URI"#Make it stateless rm cookieJar.txt此腳本的凈輸出應(yīng)該是/token端點的成功響應(yīng),作為承載令牌,包括聲明id_token 。 此聲明是JSON Web令牌(JWT)。 一個示例響應(yīng)是:
{"access_token": "RMOqVQl7WHMNDeQQBwoXlpP41cqQdZqEq5TGSZrM","token_type": "Bearer","expires_in": 7199,"scope": "openid profile email","refresh_token": "M62yhoNS7uGYboXGy7hJsHCyx6DhdMaCJFYEEXvtwNf18zY1AP","id_token": "eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FjbWVQcm92aWRlci5jb20iLCJhdF9oYXNoIjoiVWtwMlo3SnFnSDRna2lPTGJZZnJpQSIsInN1YiI6InRlc3R1c2VyIiwiYXVkIjoiOXNwOWhKck1YcExES1BWWTU3TTQiLCJyZWFsbU5hbWUiOiJtZ2EiLCJleHAiOjE0NDQ5NzY4NTMsImlhdCI6MTQ0NDk2OTY1M30.ViLy3ixFSkNBfMUFscFiQA6dVWJp4i0QjL7r0_c6e1s" }id_token由三部分組成,前兩部分是base64URL編碼的JSON。 第三個是用于驗證JWT的簽名。
$ JWT="eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL2FjbWVQcm92aWRlci5jb20iLCJhdF9oYXNoIjoiVWtwMlo3SnFnSDRna2lPTGJZZnJpQSIsInN1YiI6InRlc3R1c2VyIiwiYXVkIjoiOXNwOWhKck1YcExES1BWWTU3TTQiLCJyZWFsbU5hbWUiOiJtZ2EiLCJleHAiOjE0NDQ5NzY4NTMsImlhdCI6MTQ0NDk2OTY1M30.ViLy3ixFSkNBfMUFscFiQA6dVWJp4i0QjL7r0_c6e1s" $ JWT_HEAD=$(echo $JWT | cut -f1 -d".") $ echo $JWT_HEAD | base64 -d {"alg":"HS256"} $ JWT_BODY=$(echo $JWT | cut -f2 -d".") $ echo $JWT_BODY | base64 -d {"iss": "https://acmeProvider.com","at_hash": "Ukp2Z7JqgH4gkiOLbYfriA","sub": "testuser","aud": "9sp9hJrMXpLDKPVY57M4","realmName": "mga","exp": 1444976853,"iat": 1444969653 }自省令牌
令牌自省端點允許客戶端找出access_token的有效性。 該端點需要使用客戶端憑據(jù)進行身份驗證。 一個示例請求將是:
#!/bin/bash REVERSE_PROXY_HOSTNAME=isam-demo ACCESS_TOKEN=zWmP2T7qITV2ibMKaicNl8gxoQ9oWlWNX6VAExPE PROVIDER_ID=acmeProvider CLIENT_ID=9sp9hJrMXpLDKPVY57M4 CLIENT_SECRET=BYjqNcIHWGrP0wseZMNgcurl -k -u $CLIENT_ID:$CLIENT_SECRET \ https://$REVERSE_PROXY_HOSTNAME/isam/oidc/endpoint/amapp-runtime-$PROVIDER_ID/introspect \ -d "token=$ACCESS_TOKEN"這將產(chǎn)生以下輸出:
{"sub": "testuser","grant_type": "authorization_code","realmName": "mga","scope": "openid profile email","active": true,"exp": 1445228044,"token_type": "Bearer","iat": 1445220844,"client_id": "9sp9hJrMXpLDKPVY57M4" }這提供了足夠的信息,可以用預(yù)期的信息正確地填充STSUU 。
注意:第2、3、5、7和10行中的值將在映射規(guī)則中提取并返回到反向代理,然后將其作為屬性包括在內(nèi)。
步驟3.,配置STS鏈
要配置的STS鏈采用一個STSUU,并根據(jù)其內(nèi)容添加WebSEAL可以用作授權(quán)決策的屬性。 這是一個定義明確的接口 。 通過以下步驟配置STS鏈:
創(chuàng)建鏈模板
通過STS用戶界面完成創(chuàng)建STS模板。 對于此鏈,您需要三個模塊:
- 模式下的STSUU模塊validate
- 模式map默認映射模塊
- STSUU模塊處于模式issue
請按照以下步驟配置模板:
上載映射規(guī)則
在創(chuàng)建鏈的實例之前,需要上載默認映射模塊要使用的映射規(guī)則。 有一個Web界面,允許上載和編輯JavaScript映射規(guī)則。 將要上載的映射規(guī)則執(zhí)行以下操作:
此映射規(guī)則填充“ 授權(quán)執(zhí)行點的OAuth STS接口 ”中定義的大多數(shù)屬性。
映射規(guī)則為:
//Use the trace strings below to debug: //com.tivoli.am.fim.trustserver.sts.utilities.* so IDMappingExtUtils.traceString will show. //com.tivoli.am.fim.trustserver.sts.modules.* rule execution pre/post //com.ibm.security.access.httpclient.* http client debugging. importPackage(Packages.com.tivoli.am.fim.trustserver.sts); importPackage(Packages.com.tivoli.am.fim.trustserver.sts.uuser); importPackage(Packages.com.tivoli.am.fim.trustserver.sts.utilities); importPackage(Packages.com.ibm.security.access.httpclient);// Types: var attribute = "urn:ibm:names:ITFIM:oauth:response:attribute"; var decision = "urn:ibm:names:ITFIM:oauth:response:decision"; var param = "urn:ibm:names:ITFIM:oauth:param";//Names(minimum): var USERNAME = "username"; var AUTHZ = "authorized"; var EXPIRES = "expires"; var AT = "access_token";//Names (extra):var CLIENT_TYPE = "client_type"; // "confidential" or "public" var SCOPE = "scope"; var TOKEN_CLIENT_ID = "oauth_token_client_id"//Constants: var TRUE = "TRUE"; var FALSE = "FALSE";// Introspect details: var ENDPOINT = "https://127.0.0.1/oidc/endpoint/amapp-runtime-acmeProvider/introspect";// Used to authenticate to /introspect var CLIENT_ID = "websealClient"; var CLIENT_SECRET = "websealClientSecret";var access_token = stsuu.getContextAttributes().getAttributeValueByName(AT);IDMappingExtUtils.traceString("access_token: " + access_token); if (access_token != null || access_token.trim() != "" ) {var body = "token=" + access_token;IDMappingExtUtils.traceString("body: " + body);var headers = new Headers();headers.addHeader("Accept", "*/*");/** httpPost(String url,* Map headers,* String body,* String httpsTrustStore,* String basicAuthUsername,* String basicAuthPassword,* String clientKeyStore,* String clientKeyAlias);*/var hr = HttpClient.httpPost(ENDPOINT,headers,body,"rt_profile_keys",CLIENT_ID,CLIENT_SECRET,null, null)IDMappingExtUtils.traceString("code: " + hr.getCode());IDMappingExtUtils.traceString("body: " + hr.getBody());if (hr.getCode() == "200") {var rsp = JSON.parse(hr.getBody());IDMappingExtUtils.traceString("active:" + rsp.active);IDMappingExtUtils.traceString("is active:" + (rsp.active == true));IDMappingExtUtils.traceString("clientId:" + rsp.client_id);IDMappingExtUtils.traceString("sub:" + rsp.sub);//active will be false if its bad otherwiseif(rsp.active == true) {// active == authorizedstsuu.addAttribute(new Attribute(AUTHZ, decision, TRUE));//Some attributesstsuu.addAttribute(new Attribute(USERNAME, attribute, rsp.sub));stsuu.addAttribute(new Attribute(TOKEN_CLIENT_ID, attribute, rsp.client_id));stsuu.addAttribute(new Attribute(SCOPE, attribute, rsp.scope));stsuu.addAttribute(new Attribute(EXPIRES, decision, secondsToDate(rsp.exp)));// Based on the grant type used to get this// access_token we decide on the client_type:if(rsp.grant_type == "authorization_code"){stsuu.addAttribute(new Attribute(CLIENT_TYPE, attribute, "confidential"));} else {stsuu.addAttribute(new Attribute(CLIENT_TYPE, attribute, "public"));}} else {IDMappingExtUtils.traceString("invalid access token");stsuu.addAttribute(new Attribute(AUTHZ, decision, FALSE));}} else {IDMappingExtUtils.traceString("non 200 code");stsuu.addAttribute(new Attribute(AUTHZ, decision, FALSE));}} else {IDMappingExtUtils.traceString("access_token was null");stsuu.addAttribute(new Attribute(AUTHZ, decision, FALSE)); }/** Helper:* Turn an OIDC exp property which is in seconds and turn it into a string* suitable for the EXPIRES attribute of a STSUU*/ function secondsToDate(seconds) {var d = new Date(0);d.setSeconds(seconds);IDMappingExtUtils.traceString("Expires:" + d);return IDMappingExtUtils.getTimeStringUTC(d.getFullYear(),d.getMonth(),d.getDay(),d.getHours(),d.getMinutes(),d.getSeconds()); }創(chuàng)建鏈
現(xiàn)在有了模板,您可以配置映射規(guī)則以使用鏈的實例。 使用反向代理調(diào)用鏈時將使用的值來配置鏈。 頒發(fā)者地址必須為urn:ibm:ITFIM:oauth20:token:bearer ,但是您可以配置反向代理提供的“應(yīng)用于”。 它將顯示的默認值為https://localhost/sps/oauthfed/oauth10 。 可以在[oauth]節(jié)的default-fed-id屬性default-fed-id設(shè)置反向代理將使用的值。 本示例使用https://localhost/sps/oidc的“應(yīng)用于”值。
測試鏈
您可以使用下面的代碼片段測試配置的STS鏈。 該請求必須是包含請求安全令牌的SOAP消息。 反向代理將發(fā)送的消息將包含有關(guān)請求的端點和反向代理的幾條信息。 但是,提供的規(guī)則僅使用“ access_token”上下文屬性。 下面的示例僅提供一個access_token。 反向代理提供的屬性可用于增強規(guī)則。
#!/bin/bash #For more on invoking the STS via HTTP.REVERSE_PROXY_HOSTNAME=isam-demo ISSUER=urn:ibm:ITFIM:oauth20:token:bearer APPLIES_TO=https://localhost/sps/oidc ACCESS_TOKEN=39eAcg8X9PUN6CWGoF9Wnti1KDME9IsjeR8y49fh USER=easuser PASSWORD=passw0rdBODY=' <SOAP-ENV:Envelopexmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:ns1="http://docs.oasis-open.org/ws-sx/ws-trust/200512"xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"xmlns:wst="http://docs.oasis-open.org/ws-sx/ws-trust/200512" ><SOAP-ENV:Body><ns1:RequestSecurityTokenCollection><ns1:RequestSecurityToken><wsp:AppliesTo><wsa:EndpointReference><wsa:Address>https://localhost/sps/oidc</wsa:Address></wsa:EndpointReference></wsp:AppliesTo><wst:Issuer><wsa:Address>urn:ibm:ITFIM:oauth20:token:bearer</wsa:Address></wst:Issuer><wst:RequestType>http://schemas.xmlsoap.org/ws/2005/02/trust/Validate</wst:RequestType><wst:Base><stsuuser:STSUniversalUser xmlns:stsuuser="urn:ibm:names:ITFIM:1.0:stsuuser"><stsuuser:Principal/><stsuuser:AttributeList/><stsuuser:RequestSecurityToken><stsuuser:Attribute name="AppliesTo" type="http://schemas.xmlsoap.org/ws/2004/09/policy"><stsuuser:Value>https://localhost/sps/oidc</stsuuser:Value></stsuuser:Attribute><stsuuser:Attribute name="Issuer" type="http://docs.oasis-open.org/ws-sx/ws-trust/200512"><stsuuser:Value>urn:ibm:ITFIM:oauth20:token:bearer</stsuuser:Value></stsuuser:Attribute><stsuuser:Attribute name="Base" type="urn:ibm:names:ITFIM:1.0:stsuuser"><stsuuser:Value><stsuuser:STSUniversalUser><stsuuser:ContextAttributes><stsuuser:Attribute name="access_token" type="urn:ibm:names:ITFIM:oauth:param"><stsuuser:Value>QLW6clF6O6NEXu8KjMZ2r2u9Si4qYtEC67EUMYon</stsuuser:Value></stsuuser:Attribute></stsuuser:ContextAttributes></stsuuser:STSUniversalUser></stsuuser:Value></stsuuser:Attribute></stsuuser:RequestSecurityToken><stsuuser:ContextAttributes><stsuuser:Attribute name="access_token" type="urn:ibm:names:ITFIM:oauth:param"><stsuuser:Value>QLW6clF6O6NEXu8KjMZ2r2u9Si4qYtEC67EUMYon</stsuuser:Value></stsuuser:Attribute></stsuuser:ContextAttributes><stsuuser:AdditionalAttributeStatement/></stsuuser:STSUniversalUser></wst:Base></ns1:RequestSecurityToken></ns1:RequestSecurityTokenCollection></SOAP-ENV:Body> </SOAP-ENV:Envelope> ' curl -k -vvv --user $USER:$PASSWORD \ https://$REVERSE_PROXY_HOSTNAME/isam/TrustServerWS/SecurityTokenServiceWST13 -d "$BODY"注意:端點將需要附加一個unauth acl 。 或者,將運行時綁定到外部接口,并更新URL以直接進入運行時。 注意: STS受BA身份驗證的保護。 有關(guān)配置用戶帳戶的更多信息,請參見管理用戶注冊表 。
步驟4.將反向代理配置為實施點
現(xiàn)在,您需要將反向代理配置為OAuth PEP。 您將使用之前的相同實例。 對配置文件進行以下更改,以啟用OAuth授權(quán)。 記下default-fed-id紙default-fed-id值,因為它必須與STS鏈的“應(yīng)用于”值相對應(yīng)。
[oauth] fed-id-param = FederationId default-fed-id = https://localhost/sps/oidc user-identity-attribute = username oauth-auth = both cluster-name = oauth-cluster[server] http-method-disabled-remote = TRACE,CONNECT[tfim-cluster:oauth-cluster] basic-auth-user = easuser basic-auth-passwd = passw0rd handle-idle-timeout = 240 handle-pool-size = 10 ssl-keyfile = pdsrv.kdb ssl-keyfile-stash = pdsrv.sth server = 9,https://127.0.0.1/TrustServerWS/SecurityTokenServiceWST13 ssl-keyfile-label = server [azn-decision-info] HTTP_CONTENT_TYPE_HDR = header:content-type HTTP_HOST_HDR = header:host HTTP_REQUEST_METHOD = method HTTP_TRANSFER_ENCODING_HDR = header:transfer-encoding HTTP_AZN_HDR = header:authorization HTTP_REQUEST_URI = uri HTTP_REQUEST_SCHEME = scheme這是在下面的代碼段中編寫的腳本。
#! /bin/bash USER=admin PASSWORD= HOST= INST=default APPLIES_TO=https://localhost/sps/oidc RUNTIME=127.0.0.1function setEntry {STZ=$1bENT=$2VAL=$3curl -k -H "Accept: application/json" -H "Content-Type: application/json" \--user $USER:$PASSWORD https://$HOST/wga/reverseproxy/$INST/configuration/stanza/$STZ/entry_name/$ENT \-X PUT -d '{"value":"'$VAL'"}'}setEntry oauth fed-id-param FederationId setEntry oauth default-fed-id $APPLIES_TO setEntry oauth user-identity-attribute username setEntry oauth oauth-auth both setEntry oauth cluster-name oauth-clustersetEntry server http-method-disabled-remote TRACE,CONNECTsetEntry "tfim-cluster:oauth-cluster" ssl-keyfile-stash pdsrv.sth setEntry "tfim-cluster:oauth-cluster" basic-auth-user easuser setEntry "tfim-cluster:oauth-cluster" handle-idle-timeout 240 setEntry "tfim-cluster:oauth-cluster" handle-pool-size 10 setEntry "tfim-cluster:oauth-cluster" basic-auth-passwd passw0rd setEntry "tfim-cluster:oauth-cluster" ssl-keyfile pdsrv.kdb setEntry "tfim-cluster:oauth-cluster" server 9,https://$RUNTIME/TrustServerWS/SecurityTokenServiceWST13 setEntry "tfim-cluster:oauth-cluster" ssl-keyfile-label serversetEntry azn-decision-info HTTP_CONTENT_TYPE_HDR header:content-type setEntry azn-decision-info HTTP_HOST_HDR header:host setEntry azn-decision-info HTTP_REQUEST_METHOD method setEntry azn-decision-info HTTP_TRANSFER_ENCODING_HDR header:transfer-encoding setEntry azn-decision-info HTTP_AZN_HDR header:authorization setEntry azn-decision-info HTTP_REQUEST_URI uri setEntry azn-decision-info HTTP_REQUEST_SCHEME schemecurl -k -v -L -H 'Accept: application/json' -X PUT --user $USER:$PASSWORD https://$HOST/isam/pending_changes curl -k -v -L -H 'Accept: application/json' -H "Content-Type: application/json" -X PUT \ --user $USER:$PASSWORD https://$HOST/wga/reverseproxy/$INST -d'{"operation":"restart"}'配置POP
POP需要配置為觸發(fā)OAuth EAS。 有關(guān)OAuth EAS的更多信息,請參見“ OAuth EAS的高級概述 。您可以使用以下pdadmin命令來配置POP:
pop create oidc-pop pop modify oidc-pop set attribute eas-trigger oauth_pop_trigger將此附加到根資源作為測試:
pop attach /WebSEAL/isam-op-default/ oidc-pop server replicate測試PEP
現(xiàn)在,訪問令牌可以用作通過使用Authorization:Bearer標(biāo)頭通過反向代理對請求進行身份驗證的方法。 可以按照以下步驟進行測試:
如下所示:
$ curl -v -k -L https://isam-demo/ > GET / HTTP/1.1 > User-Agent: curl/7.37.0 > Host: isam-demo > Accept: */* > < HTTP/1.1 200 OK < content-length: 12505 < content-type: text/html < date: Tue, 20 Oct 2015 01:06:46 GMT < ...<form class="login-container" method="POST"action="/pkmslogin.form?token=Unknown"> ... Login form.$ curl -v -k -L -H "Authorization: Bearer QLW6clF6O6NEXu8KjMZ2r2u9Si4qYtEC67EUMYon" \ https://isam-demo/ > GET / HTTP/1.1 > User-Agent: curl/7.37.0 > Host: isam-demo > Accept: */* > Authorization: Bearer QLW6clF6O6NEXu8KjMZ2r2u9Si4qYtEC67EUMYon > < HTTP/1.1 200 OK < content-length: 510 < content-type: text/html ...<center><img src="/pics/iv30.gif" alt=""></center> ...Reverse Proxy Landing page現(xiàn)在可以將POP附加到各種資源,以允許使用access_tokens訪問它們。
結(jié)論
這樣就完成了配置,以使ISAM反向代理能夠接受OpenID Connect訪問令牌作為身份驗證方法。 您現(xiàn)在應(yīng)該能夠:
- 通過使用UI或Web服務(wù)來配置OpenID Connect聯(lián)合身份驗證。
- 調(diào)用聯(lián)合身份驗證配置Web服務(wù)。
- 執(zhí)行OpenID Connect授權(quán)代碼流。
- 創(chuàng)建一個STS模板和鏈。
- 創(chuàng)建POP并將其附加到資源。
- 通過使用訪問令牌作為身份驗證方法從反向代理請求頁面
翻譯自: https://www.ibm.com/developerworks/security/library/se-configure-ISAM-reverse-proxy-PeP-to-OpenID-connect-provider-trs/index.html
isam 驅(qū)動程序 下載
總結(jié)
以上是生活随笔為你收集整理的isam 驱动程序 下载_将ISAM反向代理配置为与OpenID连接提供程序的PEP的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 编译原理(陈火旺)-中国大学慕课05 语
- 下一篇: 2021年荷兰经济发展研究报告