-
Notifications
You must be signed in to change notification settings - Fork 42
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
Error when authenticating: Ws-Trust #118
Comments
@ojoven toolkit does support OAuth as of commit 6dd4aca
|
Hey @georged That's great, I saw that there was a change some months ago to adapt the SDK to OAuth. I was going to ask you how to build the settings with the new data but I saw that you edited the comment with the solution. I'm having some issues yet with OnlineS2SAuth.php But it may be cache related. Thanks again. |
@ojoven you do need cache instance. You could use NullCache I suppose but then you'll be facing token request every time so it'd be better if you use a proper one. I updated sample with the null cache - try it. |
Hey @georged After adding the NullCache, the connection was successfully made. However, when retrieving doing a request to retrieve data:
We're getting an error:
After investigating, the XML was returning:
So for this, it looks like we need to check with our client so they give the necessary permissions to that user. I just want to ask you a final thing. Instead of using NullCache, I assume that we need to implement our own Cache, is that correct? Thanks so much for all your support. |
The message is about insufficient privileges for the app user. If you have working code when username was used, assign the same roles to the app user. You most certainly don't need to roll out your own cache implementation. We expect PSR-16 compliant cache (https://www.php-fig.org/psr/psr-16/) - there are plenty of those around. |
Last but not least @ojoven. Take a look at https://github.com/AlexaCRM/dynamics-webapi-toolkit - it's web api based and much more robust than the current SOAP based toolkit. That's the recommended way forward. |
Hey @georged This is perfect. Thanks so much. Yes, some specific requests are made with the WebAPI - that's why we already had the applicationId and secret - but we initially started with SOAP due to some restrictions and migrating may not be straightforward, though we'll totally consider it. Thanks for your support. |
Hi @ojoven , Thank you. Dante |
Hey @dantedantas Sorry for the delay in my response. As georged commented, you need to add a cache to the options array:
This NullCache, however, is a dummy cache and won't store your request tokens and so, the requests will be very consuming. Once you check that it works, it's time to use a real cache. In our case, we used FileSystem: You have others (Memcached, Redis, etc. here: https://github.com/php-cache) So our code looked like this: $filesystemAdapter = new Local(__DIR__ . '/'); $options = [ Hope this helps! Cheers, |
Hola @ojoven , buenas tardes. I have no idea why I am not able to implement the changes. I am getting am error.
Maybe the AppID was created wrong? Thank you/Gracias, |
@dantedantas what object you're instantiating for settings? It should be
|
Hi @ojoven, But we are getting the below Fatal error. Could you please check and guide us for the same. Fatal error: Uncaught Error: Class 'League\Flysystem\Adapter\Local' not found in C:\xampp\htdocs\sdg\wp-content\themes\edubiz_child\functions\synchronize-wordpress-dynamics\syn_contact_enquiry.php:112 By using NullCache we can able to create a successful connection. But while using the Filesystem facing the above error. Thanks! |
Hey @Nasiralijames Do you have the following in your code:
and
at the top of your file? It looks like you may be missing the vendor autoload? Without seeing the full file I can't say. Cheers |
Hi @ojoven, Sorry for the delay in my response. Thanks for the help I have added the above given line of code now and it is working fine. Thanks a lot for your guidance and help. Regards, |
Hi guys! What did I do wrongly if I'm getting this notice "Undefined index: WWW-Authenticate"? (see screenshot bellow) I created single tenant application at admin.microsoft.com according to this article https://docs.microsoft.com/en-us/power-apps/developer/data-platform/use-single-tenant-server-server-authentication#register-your-application-on-azure-ad I am using application ID and client secret in my code. |
Check your instance URL - does not look it's a valid one. Also, drop /api/data/v9.0/ part, just use https://yourorg.crm4.dynamics.com |
This is my service settings
That part /api/data/v9.0/ was added automatically. |
@janeliasprague try again because yesterday the url was not valid (perhaps transient provisioning issue). |
AbstractSettings class contains $logger member that you can set to a PSR-3 compliant logger and get extended error details. use Monolog\Logger;
...
$client = new OrganizationService($clientSettings);
$client->logger = new \Monolog\Logger( 'whatever' ); |
function detectTenantID() returns array $headers and then is looking for "WWW-Authenticate" field. But the field is called "www-authenticate". The question is - do I have the right version of the library? I've installed it using |
If you just started I really recommend you switch to https://github.com/AlexaCRM/dynamics-webapi-toolkit instead. Latter is based on Web API and is the primary toolkit moving forward. As per Readme
|
Hi,
I wanted to inform you that the SDK is not working anymore.
When trying to connect via
The client throws an error with the following message:
An error occurred when processing the security tokens in the message:You are using Ws-Trust authentication which has been deprecated and no longer supported in your environment. Please use OAuth2.0 authentication and refer https://aka.ms/dvwsdep.
Microsoft offers some documentation on how to fix this:
https://docs.microsoft.com/en-us/power-apps/developer/data-platform/authenticate-office365-deprecation
Is this something you already fixed in your premium package? I don't see it in the Premium Features, but I'd understand that this was already fixed on it. Could you please confirm?
Thanks
The text was updated successfully, but these errors were encountered: