get user personal data using php application

Tagged: , ,

This topic has 2 replies, 1 voice, and was last updated 5 years ago by abarry.

  • Author
    Posts
  • #18834
     abarry
    Participant

    Hello,
    I’m implementing UMA. Right now I have a php application I can access to it using this url : http://uma.test.com/umaTestAppli/test.php. In this application I have 2 buttons : one is used to get the authorization code and the other one is used to get the access token and the user personal data (I’m using the profile scope). I’m doing all this manually, I mean after getting the code from the redirection url, I put it in my application URL (for example : http://uma.test.com/umaTestAppli/test.php?code=b8b41f8f-e8f1-4fcb-8bf4-f9ccfbb2db2e) then I click on the last button to get the access token and the user personnal data.
    Now I want to do it in the real world. I mean I would like to do all this in one step. For example, to have one button in my application (get user paul info) and when I click on that button, the request is sent to paul (and he can see it when he accesses in his profile under “Request”). And when paul grant the access his personal data are printed in my application web page….
    Thank you for your help.

    #18846
     abarry
    Participant

    Maybe I should try to ask my question in another way… I’m using this request : http://openam.test.com:8080/openam/oauth2/authorize?realm=/openLDAP&client_id=agent1&redirect_uri=http://openam.test.com:8080/openam&response_type=code&scope=profile to obtain the authorization code after user logging and clicking on ‘allow’. Is there a way to ask the authentication to a specific user ? For ewample to add user=paul in the parameters ?

    I just want to have a demo that shows me some request under (Shares => Requests) when I connect to paul account. And allow paul to grant access from here. Do I need to add some configuration in openam ?
    Thank you in advance for your help.

    #18878
     abarry
    Participant

    Finally I managed to do it by following this doc section : 3.2. Accessing UMA Protected Resources. Follow those steps untill the end of this section. You will need 2 users, one is the resource owner and the other one want to access to this resource.

    But in the last step when I use this request :

    curl \
     --request POST \
     --header "Content-Type: application/json" \
     --header "Authorization: Bearer 7c9862cb-9225-4d62-98dc-0f04a6b2be1b" \
     --data \
     '{
      "ticket" : "d39bbdd7-cb72-4783-8ca0-3e9563bf8e133"
     }' \
     http://openam.test.com:8080/openam/uma/openLDAP/authz_request

    For the first time I got this error :
    {"error_description":"Internal Server Error","error":"server_error"}

    But when I try it for the second time it works… Don’t know why I need to 2 it twice to got the RPT or to send the request to the resource owner. Anyway I got what I wanted.
    Note that “openLDAP” is the subrealm I’m working on…
    Hope it will help someone…

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?