mirror of
https://github.com/OpenBankProject/API-Explorer.git
synced 2026-02-06 10:47:23 +00:00
Merge pull request #110 from hongwei1/develop
feature/added more logs for the oauth1.0 request->access converting process
This commit is contained in:
commit
357b0d430d
@ -144,11 +144,29 @@ object OAuthClient extends MdcLoggable {
|
||||
provider <- mostRecentLoginAttemptProvider.get ?~ "No provider found for callback"
|
||||
consumer <- Box(credentials.map(_.consumer)) ?~ "No consumer found for callback"
|
||||
} yield {
|
||||
//eg: authUrl = http://127.0.0.1:8080/oauth/authorize?oauth_token=LK5N1WBQZGXHMQXJT35KDHAJXUP1EMQCGBQFQQNG
|
||||
//This step is will call `provider.authorizeUrl = baseUrl + "/oauth/authorize"` endpoint, and get the request token back.
|
||||
logger.debug("oauth.provider.name = " + provider.name )
|
||||
logger.debug("oauth.provider.apiBaseUrl = " + provider.apiBaseUrl )
|
||||
logger.debug("oauth.provider.requestTokenUrl = " + provider.requestTokenUrl)
|
||||
logger.debug("oauth.provider.accessTokenUrl = " + provider.accessTokenUrl )
|
||||
logger.debug("oauth.provider.authorizeUrl = " + provider.authorizeUrl )
|
||||
logger.debug("oauth.provider.signupUrl = " + provider.signupUrl )
|
||||
logger.debug("oauth.provider.oAuthProvider.getRequestTokenEndpointUrl = " + provider.oAuthProvider.getRequestTokenEndpointUrl ) //http://127.0.0.1:8080/oauth/initiate
|
||||
logger.debug("oauth.provider.oAuthProvider.getAccessTokenEndpointUrl = " + provider.oAuthProvider.getAccessTokenEndpointUrl ) //http://127.0.0.1:8080/oauth/token
|
||||
logger.debug("oauth.provider.oAuthProvider.getAuthorizationWebsiteUrl = " + provider.oAuthProvider.getAuthorizationWebsiteUrl ) //http://127.0.0.1:8080/oauth/authorize
|
||||
logger.debug("oauth.provider.consumerKey = " + provider.consumerKey )
|
||||
logger.debug("oauth.provider.consumerSecret = " + provider.consumerSecret )
|
||||
logger.debug("oauth.consumer.getToken(request) = " + consumer.getToken)
|
||||
logger.debug("oauth.consumer.getTokenSecret(request) = " + consumer.getTokenSecret)
|
||||
//after this, consumer is ready to sign requests
|
||||
provider.oAuthProvider.retrieveAccessToken(consumer, verifier)
|
||||
//update the session credentials
|
||||
val newCredential = Credential(provider, consumer, true)
|
||||
credentials.set(Some(newCredential))
|
||||
val updateCredential = credentials.set(Some(newCredential))
|
||||
logger.debug("oauth.credential.getToken(access) = " + newCredential.consumer.getToken)
|
||||
logger.debug("oauth.credential.getTokenSecret(access) = " + newCredential.consumer.getTokenSecret)
|
||||
updateCredential
|
||||
}
|
||||
|
||||
success match {
|
||||
@ -169,22 +187,6 @@ object OAuthClient extends MdcLoggable {
|
||||
|
||||
val oauthcallbackUrl = Helper.getPropsValue("base_url", S.hostName) + "/oauthcallback"
|
||||
val authUrl = provider.oAuthProvider.retrieveRequestToken(credential.consumer, oauthcallbackUrl)
|
||||
//eg: authUrl = http://127.0.0.1:8080/oauth/authorize?oauth_token=LK5N1WBQZGXHMQXJT35KDHAJXUP1EMQCGBQFQQNG
|
||||
//This step is will call `provider.authorizeUrl = baseUrl + "/oauth/authorize"` endpoint, and get the request token back.
|
||||
logger.debug("oauth.provider.name = " + provider.name )
|
||||
logger.debug("oauth.provider.apiBaseUrl = " + provider.apiBaseUrl )
|
||||
logger.debug("oauth.provider.requestTokenUrl = " + provider.requestTokenUrl)
|
||||
logger.debug("oauth.provider.accessTokenUrl = " + provider.accessTokenUrl )
|
||||
logger.debug("oauth.provider.authorizeUrl = " + provider.authorizeUrl )
|
||||
logger.debug("oauth.provider.signupUrl = " + provider.signupUrl )
|
||||
logger.debug("oauth.provider.oAuthProvider.getRequestTokenEndpointUrl = " + provider.oAuthProvider.getRequestTokenEndpointUrl ) //http://127.0.0.1:8080/oauth/initiate
|
||||
logger.debug("oauth.provider.oAuthProvider.getAccessTokenEndpointUrl = " + provider.oAuthProvider.getAccessTokenEndpointUrl ) //http://127.0.0.1:8080/oauth/token
|
||||
logger.debug("oauth.provider.oAuthProvider.getAuthorizationWebsiteUrl = " + provider.oAuthProvider.getAuthorizationWebsiteUrl ) //http://127.0.0.1:8080/oauth/authorize
|
||||
logger.debug("oauth.provider.consumerKey = " + provider.consumerKey )
|
||||
logger.debug("oauth.provider.consumerSecret = " + provider.consumerSecret )
|
||||
logger.debug("oauth.credential.getConsumerKey = " + credential.consumer.getConsumerKey)
|
||||
logger.debug("oauth.credential.getConsumerSecret = " + credential.consumer.getConsumerSecret)
|
||||
logger.debug("oauth.oauthcallbackUrl = " + oauthcallbackUrl)
|
||||
|
||||
S.redirectTo(authUrl)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user