Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to pull custom user attributes #26

Closed
ogriffithjones opened this issue Apr 7, 2018 · 5 comments
Closed

Ability to pull custom user attributes #26

ogriffithjones opened this issue Apr 7, 2018 · 5 comments

Comments

@ogriffithjones
Copy link

Hi this is less of an issue and more of a question (Not related to my issue regarding the redirect which I commented in #24 ).

Is it possible through this system (Assuming I can get it working) to pull custom user attributes that are saved against each user e.g. Company Card Number? From Azure AD B2C?

Thanks,
Oliver.

@kschroeder
Copy link
Contributor

I have not looked into how to do that, but I will put it on my list of things to do. I'd be surprised if it was not possible.

@kschroeder
Copy link
Contributor

... In the mean time, what you could check to see is if you can get that information by querying the Microsoft graph DB using the access token that you get from the entity object.

@arunandroapps
Copy link

arunandroapps commented Jul 25, 2018

Hi @kschroeder, I want group name of AD user. i have given permission in Microsoft Graph Permissions from portal but not able to get any more information.

can you look into this please
screen shot 2018-07-25 at 3 00 12 pm

@kschroeder
Copy link
Contributor

Getting data from the graph is beyond the capabilities of this code. Any identification information that is sent is done through in the id_token and there are limits on what will be sent as part of the token. As such you will likely need to query the Microsoft graph to get the information. You can try it with something like this:


$request = new \GuzzleHttp\Client();
$result = $request->get('https://graph.microsoft.com/v1.0/<resource>',[
        'headers' => [
            'Authorization' => 'Bearer ' . $entity->getAccessToken(),
            'Content-Type' => 'application/json;odata.metadata=minimal;odata.streaming=true'
        ]
    ]
);

@arunandroapps
Copy link

arunandroapps commented Jul 26, 2018

Hi thanks for the early reply,

i added this code given by you, it's responding error:-

Fatal error: Uncaught GuzzleHttp\Exception\ServerException: Server error: GET https://graph.microsoft.com/v1.0/%3Cresource%3E resulted in a 500 Internal Server Error response: <title>A potentially dangerous Request.RawUrl value was detected from the c (truncated...) in /var/www/html/AD/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:111 Stack trace: #0 /var/www/html/AD/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response)) #1 /var/www/html/AD/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp{closure}(Object(GuzzleHttp\Psr7\Response)) #2 /var/www/html/AD/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array) #3 /var/www/html/AD/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise{closure}() #4 /var/www/ in /var/www/html/AD/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php on line 111

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants