我正在为Web应用程序构建基于SAML 2.0的身份验证.身份验证是针对WSO2身份服务器(WSO2-IS)完成的.我已经设法使用HTTP重定向获得实际的身份验证.但是现在我在尝试从Identity Server"刷新"身份验证信息时遇到问题.
问题是WSO2-IS返回的断言只有5分钟的生命周期.基于此,我应该每5分钟从WSO2-IS获得一个新的断言.但是我发现没有其他方法可以对抗WSO2-IS而不是进行另一轮重定向.每五分钟将用户重定向到其他地方对用户不是很友好.
SAML 2.0指定了一个AuthnQuery请求,该请求应该使用SOAP over HTTP来完成.如果我理解正确,AuthnQuery正是我需要为用户重新请求断言信息,但对我来说似乎WSO2-IS不支持这个请求.
那么,问题是,我如何能够从WSO2 Identity Server刷新(或重新请求)断言信息,而无需将用户重定向到他们当前正在访问的页面?
我们目前正在评估WSO2身份服务器.我们希望使用电子邮件地址作为用户名.默认情况下,用户名为30个字符,不够长.它必须支持两者.和@在用户名中.有没有办法配置这个?用户存储是JDBC(Mysql)存储.
谢谢
我正在尝试刷新从wso2身份服务器获取的访问令牌(基于https://docs.wso2.com/display/IS510/Refresh+Token+Grant); 服务器返回无效的授权类型响应
{
"error": "invalid_grant",
"error_description": "Provided Authorization Grant is invalid"
}
Run Code Online (Sandbox Code Playgroud)
使用具有openid范围的"授权代码"授权类型获取访问令牌.
我打开了服务器上的日志记录; 但是,我无法确定无效授权类型响应的原因.如何使用刷新令牌让WSO2 Identity Server刷新我的访问令牌?
来自服务器的日志:
TID:[ - 1234] [] [2016-03-14 09:20:11,241] DEBUG {org.wso2.carbon.identity.oauth2.OAuth2Service} - 收到客户ID为CHao3ZYUVY6tRX4jJ82yzh4NVpka的访问令牌请求,用户ID为null,范围: [openid]和Grant Type:refresh_token
TID:[ - 1234] [] [2016-03-14 09:20:11,241] DEBUG {org.wso2.carbon.identity.oauth2.token.handlers.clientauth.AbstractClientAuthHandler} - 可以使用客户端ID和密码进行身份验证.客户ID:CHao3ZYUVY6tRX4jJ82yzh4NVpka TID:[ - 1234] [] [2016-03-14 09:20:11,241] DEBUG {org.wso2.carbon.identity.oauth2.token.handlers.clientauth.AbstractClientAuthHandler} - 授权类型:refresh_token Strict客户端验证设置为:null
TID:[ - 1234] [] [2016-03-14 09:20:11,242] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - 从数据库中提取客户端凭据.TID:[ - 1234] [] [2016-03-14 09:20:11,242] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} - 使用客户端ID成功验证客户端:CHao3ZYUVY6tRX4jJ82yzh4NVpka
TID:[ - 1234] [] [2016-03-14 09:20:11,243] DEBUG {org.wso2.carbon.identity.oauth2.util.OAuth2Util} …
我已使用以下链接将wso2身份服务器配置为wso2 api管理器的密钥管理器。1个
我已经通过wso2 api管理器发布者创建了api,并且已将auth类型指定为Application&Application user。
当我通过应用程序令牌调用api时很好。但是当我使用用户令牌时,这给了我这个错误。
<ams:fault xmlns:ams="http://wso2.org/apimanager/security"><ams:code>900908</ams:code>
<ams:message>Resource forbidden </ams:message>
<ams:description>Access failure for API: /t/dev-peakhealth.com/dev-api/1.0, version: 1.0</ams:description>
</ams:fault>
Run Code Online (Sandbox Code Playgroud)
API管理器日志:
TID: [3] [] [2016-06-13 19:18:07,074] @dev-peakhealth.com [3] [AM]DEBUG {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - Call to API gateway : API call failed reason=API_authentication_failure userName=test@dev-peakhealth.com transactionId=urn:uuid:63675ed0-1b95-4a06-9b2c-b3f7ad3daa18 with userAgent=curl/7.35.0 with accessToken=Bearer ca8569957cf1fb5d58f5b70d9649d982 for requestURI=/t/dev-peakhealth.com/dev-api/1.0/careplans at time=Mon Jun 13 19:18:07 IST 2016 from clientIP=192.168.4.31, elapsedTimeInMilliseconds=0 {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler}
TID: [3] [] [2016-06-13 19:18:07,074] @dev-peakhealth.com [3] [AM] WARN {org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler} - API authentication failure due to Resource forbidden …Run Code Online (Sandbox Code Playgroud) 我正在运行WSO2 IS 5.0.0。我将IS 5.0.0的SP以及为该版本的Identity Server和Carbon 4.2.0发行的所有其他安全补丁一起应用了。我的环境由4台正在创建集群的计算机组成(使用WKA成员身份方案和带有粘性会话的Load Balancer)。我正在使用MySQL(不是默认的H2数据库)。部署IS的计算机是Windows Server 2012 R2(EC2 AWS计算机)。PRODUCT_HOME / repository / conf / identity.xml具有以下配置:
<JDBCPersistenceManager>
<DataSource>
<Name>jdbc/WSO2CarbonDB</Name>
</DataSource>
<SessionDataPersist>
<Enable>true</Enable>
<RememberMePeriod>20060</RememberMePeriod>
<CleanUp>
<Enable>true</Enable>
<Period>1440</Period>
<TimeOut>20160</TimeOut>
</CleanUp>
<Temporary>false</Temporary>
</SessionDataPersist>
</JDBCPersistenceManager>
<SessionContextCache>
<Enable>true</Enable>
<Capacity>100000</Capacity>
</SessionContextCache>
<OAuth>
<AuthorizationCodeDefaultValidityPeriod>300</AuthorizationCodeDefaultValidityPeriod>
<AccessTokenDefaultValidityPeriod>1800</AccessTokenDefaultValidityPeriod>
<UserAccessTokenDefaultValidityPeriod>1800</UserAccessTokenDefaultValidityPeriod>
<RefreshTokenValidityPeriod>31540000</RefreshTokenValidityPeriod>
<TimestampSkew>10</TimestampSkew>
<EnableOAuthCache>false</EnableOAuthCache>
<RenewRefreshTokenForRefreshGrant>true</RenewRefreshTokenForRefreshGrant>
</OAuth>
Run Code Online (Sandbox Code Playgroud)
有时,我在Identity Server控制台日志中收到以下错误(使用client_credentials授予类型和openid范围颁发访问令牌时):
ERROR {org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder} - Error occurred while getting access token based information
ERROR {org.wso2.carbon.identity.oauth2.OAuth2Service} - Error when issuing the access token.
org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception: Error occurred while getting access token based information
at org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder.getAccessTokenIssuedTime(DefaultIDTokenBuilder.java:348)
at org.wso2.carbon.identity.openidconnect.DefaultIDTokenBuilder.buildIDToken(DefaultIDTokenBuilder.java:141) …Run Code Online (Sandbox Code Playgroud) 我已经完成了以下步骤
创建密钥库:
keytool -genkey -alias wso2carbon -keyalg RSA -keystore wso2carbon.jks -keysize 2048
Run Code Online (Sandbox Code Playgroud)克里特岛证书要求:
keytool -certreq -alias wso2carbon -keystore wso2carbon.jks -storepass wso2carbon
Run Code Online (Sandbox Code Playgroud)购买了Comodo PositiveSSL证书
将所有证书导入到新创建的密钥库-wso2carbon.jks:
keytool -import -alias root -keystore wso2carbon.jks -trustcacerts -file AddTrustExternalCARoot.crt -storepass wso2carbon
keytool -import -alias intermediate1 -keystore wso2carbon.jks -trustcacerts -file COMODORSAAddTrustCA.crt -storepass wso2carbon
keytool -import -alias intermediate2 -keystore wso2carbon.jks -trustcacerts -file COMODORSADomainValidationSecureServerCA.crt -storepass wso2carbon
keytool -import -alias domain.com -keystore wso2carbon.jks -trustcacerts -file domain_com.crt -storepass wso2carbon
Run Code Online (Sandbox Code Playgroud)将wso2carbon.jks复制到{CARBON_HOME} / repository / resources / security /并覆盖旧的。
重新启动WSO2 IS。当我用浏览器检查时,它说在证书层次结构中仅存在domain.com。
在v 4.6.0中,我们无法通过UI删除tenats,只能禁用.但是,我发现TenantMgtAdminService soap服务上有一个deleteTenant方法.
我试过调用这个服务,但是我收到了一个错误.从日志中,它具有:
{org.wso2.carbon.tenant.mgt.services.TenantMgtAdminService} - Error deleting tenant with domain: test7.tenant and tenant id: 136. {org.wso2.carbon.tenant.mgt.services.TenantMgtAdminService}
java.lang.NullPointerException
at org.wso2.carbon.tenant.mgt.services.TenantMgtAdminService.deleteTenant(TenantMgtAdminService.java:520)
Run Code Online (Sandbox Code Playgroud)
查看源代码,我认为这可能是一个缺陷,因为空指针异常似乎是由尝试访问第520行周围的"计费服务"引起的.
所以我想知道我是否可以通过这种计费服务不会为空的方式配置我的租户,或者是否有其他解决方法?
谢谢
我安装并配置了WSO2 IS 5.0但我希望用户通过代理访问.所以我想知道WSO2是否有WSO2 IS代理?或者WSO2有没有用于此目的的产品?
作为上下文,我一直在尝试获得一个相当简单的 @SprintBootApplication,其中包含一个附加的 @EnableOAuth2Sso 注释,并且与 WSO2 Identity Server 集成了很长一段时间。
在我看来,让这个工作应该是一个配置问题(正如在Spring Cloud Security上所宣传的那样) - 但到目前为止我没有运气。
为了了解发生了什么,我使用调试器逐步执行 spring-security-oauth2 代码以找出发生了什么。这样做时,我注意到我的 AccessTokenRequest 的 PreservedState 永远为空,并产生与 CSRF 相关的 InvalidRequestException。这是相关代码:
public class AuthorizationCodeAccessTokenProvider extends OAuth2AccessTokenSupport implements AccessTokenProvider {
....
private MultiValueMap<String, String> getParametersForTokenRequest(AuthorizationCodeResourceDetails resource,
AccessTokenRequest request) {
MultiValueMap<String, String> form = new LinkedMultiValueMap<String, String>();
form.set("grant_type", "authorization_code");
form.set("code", request.getAuthorizationCode());
Object preservedState = request.getPreservedState();
if (request.getStateKey() != null || stateMandatory) {
// The token endpoint has no use for the state so we don't send it back, …Run Code Online (Sandbox Code Playgroud) spring-security wso2is spring-boot spring-security-oauth2 spring-cloud
我正在评估WSO2 Identity Server 5.0.0,但我在使用仪表板时遇到了一个奇怪的问题.我将它安装在我的服务器上(因此它不在localhost上)并配置以下配置文件,以便WSO2知道在哪里指向
文件 wso2is-5.0.0/repository/conf/carbon.xml
<HostName>SERVER_IP</HostName>
<MgtHostName>SERVER_IP</MgtHostName>
Run Code Online (Sandbox Code Playgroud)
文件 wso2is-5.0.0/repository/conf/security/saml2.federation.properties
WSO2=https://SERVER_IP:9445/samlsso
Run Code Online (Sandbox Code Playgroud)
文件 wso2is-5.0.0/repository/conf/security/sso-idp-config.xml
<SSOIdentityProviderConfig>
<ServiceProviders>
<ServiceProvider>
<Issuer>wso2.my.dashboard</Issuer>
<AssertionConsumerService>https://SERVER_IP:9443/dashboard/acs</AssertionConsumerService>
...
Run Code Online (Sandbox Code Playgroud)
正如官方文档中所述,我应该看到一些块,在单击"查看详细信息"按钮后,我应该能够执行与每个块相关的仪表板操作.
但是,当我在仪表板中登录时,我可以看到块,但是当我点击"查看详细信息"时,我会看到一个空白内容页面,您可以在"我的个人资料"页面的以下屏幕截图中看到

其他块也会发生同样的事情.
我能做什么?也许我没配置什么?
先感谢您
朱利奥
wso2is ×10
wso2 ×9
wso2carbon ×2
assertion ×1
certificate ×1
saml-2.0 ×1
spring-boot ×1
spring-cloud ×1
ssl ×1