Hi @tom, I am getting the same response while exchanging authorization code with the access token via the token end point. The above solution did not worked for me.
I am developing a iOS SDK for Authentication and authorization for my organisation.
For API calls i am using Alamofire.
Deployment target is iOS 11.4
Below are the details for each of my webservice calls :
- Authn endpoint
REQUEST -
*$ curl -v *
*-X POST *
*-b âproximity_beb48734015c875160c574c2696a4f68=Ej60dXl725NxOJ0C6TgeKyDHKkJMPV4YpgMHAuXzLsKdpa25jeuSBgIgFOwXy5fnoDY3f7BAlTfOtVjAjTuIdf3xsZXAy6NHP9TKbhxZvLa62cYvmQ/X2ARMwV8sJtzwK0CeEwdqanhIwblGYOpcCtRHoqkJqqfWgZnDhqZTwcplCoNNK3FFtVaH53jsqZXY;DT=DI0YLv4MQBGQlusEP4JiLfBCgâ *
*-H âContent-Type: application/jsonâ *
*-H âAccept-Language: en;q=1.0â *
*-H âUser-Agent: AuthenticationSample/1.0 (PB.AuthenticationSample; build:1; iOS 11.4.0) Alamofire/4.8.0â *
*-H âAccept-Encoding: gzip;q=1.0, compress;q=0.5â *
*-d â{âusernameâ:âXXX@XXX.comâ,âpasswordâ:âsomepasswordâ}â *
"https://{domain}/api/v1/authn"
RESPONSE-
<NSHTTPURLResponse: 0x610000026280> { URL: https://{domain}/api/v1/authn } { Status Code: 200, Headers {
âCache-Controlâ = (
âno-cache, no-storeâ
);
Connection = (
âKeep-Aliveâ
);
âContent-Encodingâ = (
gzip
);
âContent-Typeâ = (
âapplication/json;charset=UTF-8â
);
Date = (
âThu, 03 Jan 2019 07:30:41 GMTâ
);
Expires = (
0
);
âKeep-Aliveâ = (
âtimeout=315, max=200â
);
P3P = (
âCP=âHONKââ
);
Pragma = (
âno-cacheâ
);
âPublic-Key-Pins-Report-Onlyâ = (
âpin-sha256=âjZomPEBSDXoipA9un78hKRIeN/+U4ZteRaiX8YpWfqc=â; pin-sha256=âaxSbM6RQ+19oXxudaOTdwXJbSr6f7AahxbDHFy3p8s8=â; pin-sha256=âSE4qe2vdD9tAegPwO79rMnZyhHvqj3i5g1c2HkyGUNE=â; pin-sha256=âylP0lMLMvBaiHn0ihLxHjzvlPVQNoyQ+rMiaj0da/Pw=â; max-age=60; report-uri=âhttps://okta.report-uri.io/r/default/hpkp/reportOnlyââ
);
Server = (
nginx
);
âSet-Cookieâ = (
âsid=â"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/",
âJSESSIONID=F731CD24B428B6D2ACD6E807E0F50900; Path=/; Secure; HttpOnlyâ
);
âStrict-Transport-Securityâ = (
âmax-age=315360000â
);
âTransfer-Encodingâ = (
Identity
);
Vary = (
âAccept-Encodingâ
);
âX-Content-Type-Optionsâ = (
nosniff
);
âX-Okta-Request-Idâ = (
XC26IGe1wfLFB5epb2v0BgAAAbQ
);
âX-Rate-Limit-Limitâ = (
600
);
âX-Rate-Limit-Remainingâ = (
592
);
âX-Rate-Limit-Resetâ = (
1546500685
);
} }
- Authorize
REQUEST-
*$ curl -v *
*-b âJSESSIONID=F731CD24B428B6D2ACD6E807E0F50900;proximity_beb48734015c875160c574c2696a4f68=Ej60dXl725NxOJ0C6TgeKyDHKkJMPV4YpgMHAuXzLsKdpa25jeuSBgIgFOwXy5fnoDY3f7BAlTfOtVjAjTuIdf3xsZXAy6NHP9TKbhxZvLa62cYvmQ/X2ARMwV8sJtzwK0CeEwdqanhIwblGYOpcCtRHoqkJqqfWgZnDhqZTwcplCoNNK3FFtVaH53jsqZXY;DT=DI0YLv4MQBGQlusEP4JiLfBCgâ *
*-H âAccept-Language: en;q=1.0â *
*-H âSet-Cookie: sid=â"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=F731CD24B428B6D2ACD6E807E0F50900; Path=/; Secure; HttpOnly" *
*-H âUser-Agent: AuthenticationSample/1.0 (PB.AuthenticationSample; build:1; iOS 11.4.0) Alamofire/4.8.0â *
*-H âAccept-Encoding: gzip;q=1.0, compress;q=0.5â *
"https://{domain}/oauth2/v1/authorize?state=staticState&prompt=none&response_type=code&redirect_uri={redirect_uri}&client_id={client_it}&nonce=staticNonce&sessionToken={session_token}&response_mode=query&scope=openid%20offline_access"
RESPONSE-
<NSHTTPURLResponse: 0x610000026bc0> { URL: https://{domain}/oauth2/v1/authorize?state=staticState&prompt=none&response_type=code&redirect_uri={redirect_uri}&client_id={client_id}&nonce=staticNonce&sessionToken={token}&response_mode=query&scope=openid%20offline_access } { Status Code: 302, Headers {
âCache-Controlâ = (
âno-cache, no-storeâ
);
Connection = (
âKeep-Aliveâ
);
âContent-Languageâ = (
en
);
âContent-Lengthâ = (
0
);
Date = (
âThu, 03 Jan 2019 07:32:47 GMTâ
);
Expires = (
0
);
âKeep-Aliveâ = (
âtimeout=315, max=200â
);
Location = (
â{redirect_uri}?code=3-AIN-UcpzYa3SRAacOn&state=staticStateâ
);
P3P = (
âCP=âHONKââ
);
Pragma = (
âno-cacheâ
);
âPublic-Key-Pins-Report-Onlyâ = (
âpin-sha256=âjZomPEBSDXoipA9un78hKRIeN/+U4ZteRaiX8YpWfqc=â; pin-sha256=âaxSbM6RQ+19oXxudaOTdwXJbSr6f7AahxbDHFy3p8s8=â; pin-sha256=âSE4qe2vdD9tAegPwO79rMnZyhHvqj3i5g1c2HkyGUNE=â; pin-sha256=âylP0lMLMvBaiHn0ihLxHjzvlPVQNoyQ+rMiaj0da/Pw=â; max-age=60; report-uri=âhttps://okta.report-uri.io/r/default/hpkp/reportOnlyââ
);
âReferrer-Policyâ = (
âno-referrerâ
);
Server = (
nginx
);
âSet-Cookieâ = (
âJSESSIONID=1CEF91CF00FBF32F8C9689E5151471DC; Path=/; Secure; HttpOnlyâ,
ât=purple; Path=/â,
âsid=102F6NMOZE7RPqPgokAREnKIQ; Path=/; Secureâ,
âproximity_beb48734015c875160c574c2696a4f68=Ej60dXl725NxOJ0C6TgeKyDHKkJMPV4YpgMHAuXzLsKdpa25jeuSBgIgFOwXy5fnoDY3f7BAlTfOtVjAjTuIdf3xsZXAy6NHP9TKbhxZvLa62cYvmQ/X2ARMwV8sJtzwK0CeEwdqanhIwblGYOpcCtRHoqkJqqfWgZnDhqZTwcplCoNNK3FFtVaH53jsqZXY; Expires=Fri, 03-Jan-2020 07:32:47 GMT; Path=/; Secureâ
);
âStrict-Transport-Securityâ = (
âmax-age=315360000â
);
âX-Okta-Request-Idâ = (
XC26n56CNkxxHLh8fMVtLQAAAbk
);
âX-Rate-Limit-Limitâ = (
40
);
âX-Rate-Limit-Remainingâ = (
39
);
âX-Rate-Limit-Resetâ = (
1546500777
);
âX-Robots-Tagâ = (
none
);
} }
- AccessToken-
REQUEST-
*$ curl -v *
*-X POST *
*-b âJSESSIONID=1CEF91CF00FBF32F8C9689E5151471DC;proximity_beb48734015c875160c574c2696a4f68=Ej60dXl725NxOJ0C6TgeKyDHKkJMPV4YpgMHAuXzLsKdpa25jeuSBgIgFOwXy5fnoDY3f7BAlTfOtVjAjTuIdf3xsZXAy6NHP9TKbhxZvLa62cYvmQ/X2ARMwV8sJtzwK0CeEwdqanhIwblGYOpcCtRHoqkJqqfWgZnDhqZTwcplCoNNK3FFtVaH53jsqZXY;sid=102F6NMOZE7RPqPgokAREnKIQ;t=purple;DT=DI0YLv4MQBGQlusEP4JiLfBCgâ *
*-H âContent-Type: application/x-www-form-urlencodedâ *
*-H âAccept-Language: en;q=1.0â *
*-H âSet-Cookie: sid=â"; Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/, JSESSIONID=F731CD24B428B6D2ACD6E807E0F50900; Path=/; Secure; HttpOnly" *
*-H âUser-Agent: AuthenticationSample/1.0 (PB.AuthenticationSample; build:1; iOS 11.4.0) Alamofire/4.8.0â *
*-H âAccept-Encoding: gzip;q=1.0, compress;q=0.5â *
*-d âgrant_type=authorization_code&client_secret={client_secret}&scope=openid%20offline_access&redirect_uri={redirect_uri}&code=3-AIN-UcpzYa3SRAacOn&client_id={client_id}â *
"https://{domain}/oauth2/v1/token"
RESPONSE-
<NSHTTPURLResponse: 0x608000027d00> { URL: https://{domain}/oauth2/v1/token } { Status Code: 403, Headers {
Connection = (
âKeep-Aliveâ
);
âContent-Lengthâ = (
0
);
Date = (
âThu, 03 Jan 2019 07:37:55 GMTâ
);
âKeep-Aliveâ = (
âtimeout=315, max=200â
);
P3P = (
âCP=âHONKââ
);
âPublic-Key-Pins-Report-Onlyâ = (
âpin-sha256=âjZomPEBSDXoipA9un78hKRIeN/+U4ZteRaiX8YpWfqc=â; pin-sha256=âaxSbM6RQ+19oXxudaOTdwXJbSr6f7AahxbDHFy3p8s8=â; pin-sha256=âSE4qe2vdD9tAegPwO79rMnZyhHvqj3i5g1c2HkyGUNE=â; pin-sha256=âylP0lMLMvBaiHn0ihLxHjzvlPVQNoyQ+rMiaj0da/Pw=â; max-age=60; report-uri=âhttps://okta.report-uri.io/r/default/hpkp/reportOnlyââ
);
Server = (
nginx
);
âX-Okta-Request-Idâ = (
âXC270yR-OwFvj3AWjXWOgQAAA5Eâ
);
âX-Rate-Limit-Limitâ = (
40
);
âX-Rate-Limit-Remainingâ = (
39
);
âX-Rate-Limit-Resetâ = (
1546501085
);
} }
I have tried my different things on this but nothing worked.
The same thing is working in Postman, and also for the android developers in my team.
Need urgent help.