2017-06-28 56 views

回答

0
  1. 这是为了让出的access_token当前进程的首选和推荐的方法。

    String accessToken = null; 
    Subject subj = WSSubject.getRunAsSubject(); 
    Set<WSOAuth20Token> credentials = subj.getPrivateCredentials(WSOAuth20Token.class); 
    if (credentials != null) 
    { 
        WSOAuth20Token oauth2token = credentials.iterator().next(); 
        accessToken = oauth2token.getTokenString(); 
    } 
    
  2. 如果你真的想从请求参数读一遍,你可以按照这个指令可以工作,但我不想推荐它,并没有对其进行测试。 https://www.ibm.com/support/knowledgecenter/SSAW57_8.5.5/com.ibm.websphere.nd.multiplatform.doc/ae/rweb_custom_props.html#enablemultiplereadsofpostdata
+0

感谢您的意见!我会尝试。问候ERA –

+0

这是WSOAuth20Token.class的包? –

+1

com.ibm.wsspi.security.oauth20.token.WSOAuth20Token – Chunlong

相关问题