I am trying on ways to get access token for oAuth2 programmatically. Able to get this only from web browser using url request:
https://<app sever>/apex/<workspace>/oauth2/auth?response_type=token&client_id=<client Id>&state=<State variable>
When I do this over curl, get redirected to sign-on page. (302 moved Temporarily)
curl -i https://<app sever>/apex/<workspace>/oauth2/auth?response_type=token&client_id=<client Id>&state=<State variable>
HTTP/1.1 302 Moved Temporarily
Date: Fri, 02 Dec 2016 19:39:01 GMT
Transfer-Encoding: chunked
Location: https://<app sever>/apex/<workspace>/sign-on?r=oa
Server: Oracle-Application-Express-Listener/2.0.5.287.04.27
X-ORACLE-DMS-ECID: *******
X-ORACLE-DMS-RID: 0
Set-Cookie: _com_ora_al_= *******..; Domain= *******; Path=/apex/<workspace>/; Secure; HttpOnly
Set-Cookie: JSESSIONID= *******!-#####; path=/; HttpOnly
Strict-Transport-Security: max-age=262800;includeSubDomains
Can you please suggest on how to obtain the access token for oAuth via curl.