Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Oauth 2.0 in NW 7.4 AS ABAP - Error "RSecDReadItem" read failed

Former Member
0 Kudos

Hi  All,

I'm trying to integrate Oauth 2.0 in my NW 7.4 AS ABAP with Google and when i try to execute the request im getting the following error in the SEC_TRACE_ANALYSER report.

Kindly help me.

REgards

Karthik

1 ACCEPTED SOLUTION

Former Member

Hi,

I was able to finally solve the issue that is no Upgrade issue.

We have to change in the BADI class Implementation

I have followed the Following blog (http://wiki.scn.sap.com/wiki/display/Security/Access+Google+APIs+using+the+OAuth+2.0+Client+API)

But in that the particular implmentaiton for Grant_type was missing .

1. goto se24   and look for class ZCL_OA2C_SPECIFICS_ZGOOGLE  (reference blog site      given above)

2. THen navigate to methods Tab search for method  IF_OA2C_SPECIFICS~GET_AC_AT_REQU_PARAM_NAMES

3. Redifine the method as below

CALL METHOD SUPER->IF_OA2C_SPECIFICS~GET_AC_AT_REQU_PARAM_NAMES

   IMPORTING

     E_GRANT_TYPE                     =      E_GRANT_TYPE

     E_GRANT_TYPE_VALUE        =      E_GRANT_TYPE_VALUE

     E_CODE                                  =      E_CODE

     E_CLIENT_ID                           =      E_CLIENT_ID

     E_CLIENT_SECRET               =      E_CLIENT_SECRET

     E_REDIRECT_URI                  =      E_REDIRECT_URI.

Finally solved !!!! 🙂 cheers

Regards

Karthik

8 REPLIES 8

martin_voros
Active Contributor
0 Kudos

Hi,

few lines above the first red line. Unable to find an entry in RSECTAB. Based on that brief part of log I am guessing that it fails to retrieve an access token that needs to be sent to a server. Have you requested it (relevant SAP documentatio)? Is it stored in the system?

Cheers

0 Kudos

Hi Martin,

Yes I'm requesting for the token as suggested by SAP using OA2C_GRANT i'm able to go to Google get authenticated and also I'm getting the consent screen.

i.e I'm able to get the authorization code from google back to my AS ABAP but the codeflow fails when my AS ABAP tries to request for tokens.  Then i get the above error.

Please SUggest.

Regards

Karthik

0 Kudos

Hi,

please check in transaction SECSTORE if the record is actually stored in ABAP AS. If no then you will have to debug why it's not getting stored. If not then reading is the problem. Have you checked authorization trace if something is there.

Cheers

0 Kudos

Hi Martin,

I checked the error it is a client issue. The error shows dat it is searching in client 000 instead of 001.

I have done the configuration of oauth again in client 000 then that stage has gone thourgh.

BUt now I'm facing the problem it says "missing grant_type" parameter when requesting for token froom google.

Kindly help .

Regards

Karthik

0 Kudos

Hi,

it seems like client is not passing grant type to server. Not sure why that is the case. More info here.

Cheers

0 Kudos

Hi,

Even i'm not able to understand why the server is not able to pass the required parameter.

I'm trying to upgrade the existing NWW 7.4 sp08  to NW 7.4 sp09. Hope it may help.

If you have any further suggestions kinldy reply.

Regards

Karthik

Former Member

Hi,

I was able to finally solve the issue that is no Upgrade issue.

We have to change in the BADI class Implementation

I have followed the Following blog (http://wiki.scn.sap.com/wiki/display/Security/Access+Google+APIs+using+the+OAuth+2.0+Client+API)

But in that the particular implmentaiton for Grant_type was missing .

1. goto se24   and look for class ZCL_OA2C_SPECIFICS_ZGOOGLE  (reference blog site      given above)

2. THen navigate to methods Tab search for method  IF_OA2C_SPECIFICS~GET_AC_AT_REQU_PARAM_NAMES

3. Redifine the method as below

CALL METHOD SUPER->IF_OA2C_SPECIFICS~GET_AC_AT_REQU_PARAM_NAMES

   IMPORTING

     E_GRANT_TYPE                     =      E_GRANT_TYPE

     E_GRANT_TYPE_VALUE        =      E_GRANT_TYPE_VALUE

     E_CODE                                  =      E_CODE

     E_CLIENT_ID                           =      E_CLIENT_ID

     E_CLIENT_SECRET               =      E_CLIENT_SECRET

     E_REDIRECT_URI                  =      E_REDIRECT_URI.

Finally solved !!!! 🙂 cheers

Regards

Karthik

0 Kudos

Hi Karthik,

thanks for sharing your solution. We're working with the same example, but ...

How did you manage that the redirect endpoint from Google back to your AS ABAP application (SICF endpoint) needs to be reachable from internet ? Is our WebAS http server fully reachable from internet ?

Thanks,

Matthias