2016-11-10 53 views
0

我对wso2is相当陌生。 我用oauth/oidc添加了一个SP并获得了客户端证书。 但是当我调用令牌端点来生成访问令牌(client_credentials流)时,我得到了一个guid /引用令牌。我如何获得独立的JWT?oauth的自包含JWT

此外,发现端点和内省不适用于5.2.0?

TIA。

回答

0

截至目前,还没有开箱即用的解决方案将独立的JWT作为来自WSO2 Identity Server的访问令牌。但是,我们有一个扩展点[1]来编写一个适合您需求的扩展点。

如果我给你在很短的步骤,

  1. 撰写的accessToken发行人的类实现此接口。您将返回签名的JWT而不是GUID。
  2. 创建罐子,并把它添加到IS_HOME /存储库/组件/的dropins
  3. 由下<OAuth>部分添加<IdentityOAuthTokenGenerator>标签完全合格的类名添加到IS_HOME /库/ conf目录/身份证/ identity.xml。

查看默认的accessTokenIssuer代码来获得想法[2]。发现端点和内省端点已添加到IS 5.3.0中。尝试从[3]

[1] https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/676c4d845842556a560874804373a422940492a9/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/token/OauthTokenIssuer.java#L25-L25

[2] https://github.com/wso2-extensions/identity-inbound-auth-oauth/blob/676c4d845842556a560874804373a422940492a9/components/org.wso2.carbon.identity.oauth/src/main/java/org/wso2/carbon/identity/oauth2/token/OauthTokenIssuerImpl.java

[3] https://github.com/wso2/product-is/releases/download/v5.3.0-alpha/wso2is-5.3.0-alpha.zip


更新

关注这个博客的alpha版本发布https://medium.com/@hasinthaindrajee/self-contained-access-tokens-with-wso2-identity-server-82111631d5b6#.s0q3xt6od以完成您的用例:)

+0

感谢您的详细信息! 为什么JWT作为访问令牌不受支持的任何原因?发现网址是什么 - 我尝试了几次,其中包括sever/oauth2/,但没有奏效。 – mosdev

+0

它的格式为https:// localhost:9443/.well-known/webfinger?resource = acct:admin @ localhost&rel = http://openid.net/specs/connect/1.0/issuer – farasath

+0

明白了 - 谢谢! – mosdev