You need to sign in to do that
Don't have an account?
Meenakshi P
Authorization Error - Invalid SessionId
Hi,
I need a help in authorization after following username-password authentication process.
I am testing with CURL command and get valid response after authentication process and then I use the accessToken as input in the
authorization and get error as Invalid Session Id. (Pasting complete error response at the end of this post)
While authorization, is my serviceUrl not correct OR is the ! which I am passing in the accessToken is the issue here?
I followed this:
http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=quickstart_oauth.htm|StartTopic=Content%2Fquickstart_oauth.htm|SkinName=webhelp
Please suggest.
Username-password Authentication Request:
curl -k -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9sG9Z3Q1RlbeivZC.BRS1ukm56EdnPXo_VGi6P1rhHWCyMEHoDSVQ6i.1XjtjN348GdUG" -d "client_secret=325135132025" -d "username=emailTest@gmail.com" -d "password=myPwdOr8gYI1XpSrq54u" -H "Content-Type: application/x-www-form-urlencoded"
Authentication Response:
{"id":"https://login.salesforce.com/id/00D1a000000Jb4ZEAS/0051a000000IWqcAAG","issued_at":"1430427928586","token_type":"Bearer","instance_url":"https://na24.salesforce.com","signature":"uuAjbGBiTxSVKss5+TXuDhdKiYkCVU6lrk7IwmVRjvE=","access_token":"00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9Vtp7aZ_OL4bEV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW"}
Authorization Request:
curl -k -v https://na24.salesforce.com/services/data/v20.0/ -H 'Authorization: Bearer 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9Vtp7aZ_OL4bEV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
Error in response:
* Connected to na24.salesforce.com (136.146.210.94) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2, TLS Unknown, Unknown (22):
* TLSv1.2, TLS handshake, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server hello (2):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, CERT (11):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server finished (14):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Client key exchange (16):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (23):
> GET /services/data/v20.0/ HTTP/1.1
> Host: na24.salesforce.com
> User-Agent: curl/7.42.0
> Accept: */*
{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]* SSL
2, Unknown (23):
Connection #0 to host na24.salesforce.com left intact
Rebuilt URL to: Bearer/
Could not resolve host: Bearer
Closing connection 1
url: (6) Could not resolve host: Bearer
Rebuilt URL to: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9V
p7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'/
Could not resolve host: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxB
y7V0X9Vtp7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
Closing connection 2
url: (6) Could not resolve host: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoA
mO6FtxBSy7V0X9Vtp7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
I need a help in authorization after following username-password authentication process.
I am testing with CURL command and get valid response after authentication process and then I use the accessToken as input in the
authorization and get error as Invalid Session Id. (Pasting complete error response at the end of this post)
While authorization, is my serviceUrl not correct OR is the ! which I am passing in the accessToken is the issue here?
I followed this:
http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=quickstart_oauth.htm|StartTopic=Content%2Fquickstart_oauth.htm|SkinName=webhelp
Please suggest.
Username-password Authentication Request:
curl -k -v https://login.salesforce.com/services/oauth2/token -d "grant_type=password" -d "client_id=3MVG9sG9Z3Q1RlbeivZC.BRS1ukm56EdnPXo_VGi6P1rhHWCyMEHoDSVQ6i.1XjtjN348GdUG" -d "client_secret=325135132025" -d "username=emailTest@gmail.com" -d "password=myPwdOr8gYI1XpSrq54u" -H "Content-Type: application/x-www-form-urlencoded"
Authentication Response:
{"id":"https://login.salesforce.com/id/00D1a000000Jb4ZEAS/0051a000000IWqcAAG","issued_at":"1430427928586","token_type":"Bearer","instance_url":"https://na24.salesforce.com","signature":"uuAjbGBiTxSVKss5+TXuDhdKiYkCVU6lrk7IwmVRjvE=","access_token":"00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9Vtp7aZ_OL4bEV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW"}
Authorization Request:
curl -k -v https://na24.salesforce.com/services/data/v20.0/ -H 'Authorization: Bearer 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9Vtp7aZ_OL4bEV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
Error in response:
* Connected to na24.salesforce.com (136.146.210.94) port 443 (#0)
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* TLSv1.2, TLS Unknown, Unknown (22):
* TLSv1.2, TLS handshake, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server hello (2):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, CERT (11):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Server finished (14):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Client key exchange (16):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (20):
* TLSv1.2, TLS change cipher, Client hello (1):
* SSLv2, Unknown (22):
* TLSv1.2, TLS handshake, Finished (20):
* SSLv2, Unknown (23):
> GET /services/data/v20.0/ HTTP/1.1
> Host: na24.salesforce.com
> User-Agent: curl/7.42.0
> Accept: */*
{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]* SSL
2, Unknown (23):
Connection #0 to host na24.salesforce.com left intact
Rebuilt URL to: Bearer/
Could not resolve host: Bearer
Closing connection 1
url: (6) Could not resolve host: Bearer
Rebuilt URL to: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxBSy7V0X9V
p7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'/
Could not resolve host: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoAEmO6FtxB
y7V0X9Vtp7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
Closing connection 2
url: (6) Could not resolve host: 00D1a000000Jb4Z!ARkAQGmONT80NeBmtF7KrJxuld0NoA
mO6FtxBSy7V0X9Vtp7aZ_OL4bV5QS47zsIjF7pqtpLWUFUkK2oTZOYEk6dqAqafW'
Please look at this post.
http://ashishsharmadevsfdc.blogspot.ae/2014/08/a-quick-salesforce-oauth-20-usage.html