2017-02-13 19 views
0

Mule Devkitコネクタプラットフォームのデフォルトメソッドを使用しているMule ConnectorでOauth2を実装しようとしています。しかし、認証後、次のエラーのためユーザートークンを使用できません。 助けてください。インクルードされたスタックトレースが役立ちます。MuleメッセージからOAuthアクセストークンを抽出できません

Root Exception stack trace: 
java.lang.IllegalArgumentException: OAuth access token could not be extracted from: { 
    "access_token" : "ya29.GlzxA5CJ8FcIay3YXE7sG2spkYYfkcTei6NW_gunsIPW2kSYJToKh1oOyUwkRoy-p-iuGIwLsi5gKvzhZQPMY9wjPkdxR6YJYVswtR3K3iGXlidqbp1_LAQoEHoX0w", 
    "expires_in" : 3599, 
    "token_type" : "Bearer" 
} 
    at org.mule.security.oauth.util.DefaultOAuthResponseParser.extractAccessCode(DefaultOAuthResponseParser.java:36) 
    at org.mule.security.oauth.BaseOAuth2Manager.fetchAndExtract(BaseOAuth2Manager.java:586) 
    at org.mule.security.oauth.BaseOAuth2Manager.fetchAccessToken(BaseOAuth2Manager.java:432) 
    at org.mule.modules.drivecon2.adapters.DriveCon2ConnectorOAuth2Adapter.fetchAccessToken(DriveCon2ConnectorOAuth2Adapter.java:207) 
    at org.mule.security.oauth.processor.OAuth2FetchAccessTokenMessageProcessor.doProcess(OAuth2FetchAccessTokenMessageProcessor.java:68) 
    at org.mule.devkit.processor.DevkitBasedMessageProcessor.process(DevkitBasedMessageProcessor.java:89) 
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) 
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108) 
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) 
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) 
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) 
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) 
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108) 
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) 
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) 
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108) 
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) 
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:88) 
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) 
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) 
    at org.mule.execution.MessageProcessorNotificationExecutionInterceptor.execute(MessageProcessorNotificationExecutionInterceptor.java:108) 
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) 
    at org.mule.execution.ExceptionToMessagingExceptionExecutionInterceptor.execute(ExceptionToMessagingExceptionExecutionInterceptor.java:27) 
    at org.mule.execution.MessageProcessorExecutionTemplate.execute(MessageProcessorExecutionTemplate.java:44) 
    at org.mule.processor.BlockingProcessorExecutor.executeNext(BlockingProcessorExecutor.java:98) 
    at org.mule.processor.BlockingProcessorExecutor.execute(BlockingProcessorExecutor.java:59) 
    at org.mule.interceptor.AbstractEnvelopeInterceptor.processBlocking(AbstractEnvelopeInterceptor.java:58) 
    at org.mule.processor.AbstractRequestResponseMessageProcessor.process(AbstractRequestResponseMessageProcessor.java:47) 
    at org.mule.processor.AsyncInterceptingMessageProcessor.processNextTimed(AsyncInterceptingMessageProcessor.java:129) 
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:213) 
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker$1.process(AsyncInterceptingMessageProcessor.java:206) 
    at org.mule.execution.ExecuteCallbackInterceptor.execute(ExecuteCallbackInterceptor.java:16) 
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:35) 
    at org.mule.execution.CommitTransactionInterceptor.execute(CommitTransactionInterceptor.java:22) 
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:30) 
    at org.mule.execution.HandleExceptionInterceptor.execute(HandleExceptionInterceptor.java:14) 
    at org.mule.execution.BeginAndResolveTransactionInterceptor.execute(BeginAndResolveTransactionInterceptor.java:67) 
    at org.mule.execution.ResolvePreviousTransactionInterceptor.execute(ResolvePreviousTransactionInterceptor.java:44) 
    at org.mule.execution.SuspendXaTransactionInterceptor.execute(SuspendXaTransactionInterceptor.java:50) 
    at org.mule.execution.ValidateTransactionalStateInterceptor.execute(ValidateTransactionalStateInterceptor.java:40) 
    at org.mule.execution.IsolateCurrentTransactionInterceptor.execute(IsolateCurrentTransactionInterceptor.java:41) 
    at org.mule.execution.ExternalTransactionInterceptor.execute(ExternalTransactionInterceptor.java:48) 
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:28) 
    at org.mule.execution.RethrowExceptionInterceptor.execute(RethrowExceptionInterceptor.java:13) 
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:110) 
    at org.mule.execution.TransactionalErrorHandlingExecutionTemplate.execute(TransactionalErrorHandlingExecutionTemplate.java:30) 
    at org.mule.processor.AsyncInterceptingMessageProcessor$AsyncMessageProcessorWorker.doRun(AsyncInterceptingMessageProcessor.java:205) 
    at org.mule.work.AbstractMuleEventWork.run(AbstractMuleEventWork.java:53) 
    at org.mule.work.WorkerContext.run(WorkerContext.java:301) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
    at java.lang.Thread.run(Thread.java:745) 

答えて

0

エラーを報告しました。 私はCredentialsを正しく渡していましたが、Regexが間違っています。値以下にアクセストークンURLを変更します。(Googleの認証応答のため。)私もミュールは、ゴーグルや他の人のために流れ、一部のOAuth2に取り組んでいます

 OAuth2(friendlyName = "OAuth 2.0", authorizationUrl = 
"https://accounts.google.com/o/oauth2/auth", 
    accessTokenUrl = "https://accounts.google.com/o/oauth2/token", 
    accessTokenRegex = "\"access_token\" : \"([^&]+?)\"", 
    expirationRegex = "\"expires_in\" : ([^&]+?),") 
0

を参照してください私のポストTrust store for googleapis.com certificate and Oauth Single Signon

トークンを抽出するにはI #[payload.access_token]

トークンを取得するための正しいURLは、www.googleapis.com:443/oauth2/v4/tokenですが、私にとってはうまくいかないと思いますトラストストアの問題のため、accounts.google.com:443/o/oauth2/tokenも使用できますが、www.googleapis.comエンドポイントはサブセットに必要ですent API呼び出しで返されたトークンを呼び出し、その時点で信頼の問題が返されます。ここにあなたの考えに興味がある、私はコメントを投稿したが、虐待のために申し訳ありません十分な点を持っていないだろう

関連する問題