Can't connect to new CRM Online Security model with XrmDataContext - dynamics-crm-online

Microsoft has changed the authentication model for new CRM sites from LiveID to Microsoft Online Services. I set up a new site this week and have it up and running but code I wrote that connects to the site using early bound classes fails to authenticate.
My connection string for an older site using LiveIDs looks like this.
I am trying to connect to the new site that uses Microsoft Online Services for authentication with this connection string
I create an instance of XrmDataContext and it seems to work OK until I actually upll data fromthe site. The error I receive is
ACS10002: An error occurred while processing the SOAP body. ACS50012: Authentication failed.
I tried all of the authentication types list here http://technet.microsoft.com/en-us/library/ff681567 and none seemed to work.
I see a lot of forum posts saying that the discovery service URL has changed so I tried adding that to my connection string.
Discovery URL=https://disco.crm.dynamics.com/XRMServices/2011/Discovery.svc
No luck.
Has anyone written code that connects to the new security model? Did you do anything special?
Thanks in advance,
Bill Wolohan

MS released a new version of the SDK on 8/17/2012. I had downloaded the latest on 8/16/2012 and that version did not work. Once I downloaded the newer version and recompiled it worked great. I just had bad timing. :-(

Related

Microsoft Appsource Onboarding #appsource

I'm new to this site so apologies if formatting or style of question is not as you would expect.We are an ISV in the process of getting a product listed on Microsoft AppSource.
We have a web application that is hosted in Azure and meets the requirements for using Azure Authentication.
Our Web application appears to be functioning normally up to the point when the AppSource team authenticate - which they do successfully - at this point they get a webpage error as follows which says ERR_TOO_MANY_REDIRECTS (see attachment)enter image description here
Can anyone suggest how to get around this ? It seems like it could be simple a proxy issue at the Microsoft end, although its not completely clear to us if this is the case. Interestingly our product acts as a proxy / reverse proxy encryption gateway.

What can we do for the error "No error field found in JSON" (VDM:401)?

We try to call the API API_BUSINESS_PARTNER via our Java application. The Java implementation communicates with a SAPUI5 - Front End application, so that the data can be displayed via an app.
Through our On - Premise System it works without any problems and we also get back data. But via the application we get the error "No error field found in JSON" and the SCP - Log for ODataConnectivityUtil shows us that the respective user is not authorized.
Accordingly we tried to call an older one MMIM_MATERIAL_DATA_SRV and it works without any problems. We get the same error message in API_PRODUCT_SRV. So it doesn't seem to work with the new APIs in general.
Thank you,
best regards.
The error message
Our source code
Logging snippet
Thanks again for the support.
We have solved the problem now.
The problem is that the first metadata request is executed on the default client (client 100) although we have set "sap-client=200" in the destination configuration.
Our passwords between the clients were different, so we received an authentication error.
We suspect that the "newer" API's will not be able to access the configuration for the destination from the SCP. So it probably worked with the older ones.
One problem for us was that the Cloud SDK does not take the client from the destination configuration (for the metadata request).
The other problem was that the error message "No error field found in JSON" was misleading.
Only by the tip with "ODataConnectivityUtil", we could see our authentication error. So thanks again.
Which version of the S/4HANA Cloud SDK are you using? This might be an issue that we had in an older version. Could you update to the latest release version and give it a try again?
Details on releases can be found here:
https://sap.github.io/cloud-s4-sdk-examples/release-notes/
Hint: I would also suggest to use our virtual data model classes that we provide for invoking such OData services. You can find a blog post on this topic here: https://blogs.sap.com/2017/05/21/step-4-with-sap-s4hana-cloud-sdk-calling-an-odata-service/
Pls take a look in the S/4HANA OData log which you can find using transaction /iwfnd/error_log (put /n before it).
Then you execute the OData call to provoke the error. If you then find an entry in the OData log, it does mean that the authentication to S/4HANA was succesful. Also then you would figure out mor error details.
In case you do not find any entry, it is very likely that you are not authenticating correctly. In this case S/4HANA returns 401 and an HTML document as response payload.

Youtube API v3 shows "Access Not Configured"

I created a Google application in the developers console, turned on "YouTube Data API v3", generated the server API key, and authorized my home and work IPs.
My website lists all videos from a Youtube channel, using the V3 API. It uses the official PHP library, passing it the server API key.
It all worked well yesterday from home, and today morning from work. Then, it suddently stoped working at 11am (GMT+1), with no action from my part, with this error:
[Google_Service_Exception] Error calling GET
https://www.googleapis.com/youtube/v3/channels?part=contentDetails&forUsername=xxxxxxxxxx&key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:
(403) Access Not Configured. The API is not enabled for your project,
or there is a per-IP or per-Referer restriction configured on your
APIkey and the request does not match these restrictions. Please use
the Google Developers Console to update your configuration.
Note: i used less than 10 requests, out of the 50 millions allowed by day, i have a static public IP address, this part of the code was untouched.
What can i look for in order to fix that, please? I really don't know where to head for from now... Thank you.
Oooook...
Do all you have to with the API activations before you generate any keys!
Unactivating or reactivating API (like "Youtube Data") silently destroys your key validity. At least for the server one.
So the solution is, when you get the same error as me:
destroy your server key (delete it completely, do not only regenerate)
deactivate then reactivate all APIs you need
create a new server key
thank Google for the so clear error messages (optional)
Additionnaly when I opened the requested URL in browser I found that the API call returned
{"domain": "usageLimits"}
I tried the above solutions without success.
Creating a new project from scratch solved the issue
Thanks #Danra, you helped, but I add this answer because your comment is default hidden.
This solved for me....
i first followed #Ninj answer...still no change.
Then, After adding my domain urls to 'allowed referers' list,
i regenerated the key alone
it then worked like a charm !
i guess google parses allowed urls from the key string itself, not from updated settings
I got frustrated and created a new project with a new key and it worked like a charm.
Solution 1:
Create new project and enable Youtube Data v3 api and create credential.
Solution 2:
Check limit Quota in Youtube Data v3 -> Quota (in left pane) &
Increase the limits per day or request for Higher Quota
I also tried everything, but could only solve this when I created a new project, gave access to the APIs I needed, and added a new key.
I also got a "Bad Request" error and this solved it.
I also tried everything, but could only solve this when I created a new project, gave access to the APIs I needed, and added a new key.

SignalR Not Working with Windows Auth

I've created a test MVC5 application to run the simple SignalR chat client shown here and everything worked as the tutorial described.
http://www.asp.net/signalr/overview/getting-started/tutorial-getting-started-with-signalr-and-mvc
I've then created another project where I enable Windows Authentication and my messages are not being received by the chat clients. However, my message requests are hitting the "ChatHub" Send method but my chat clients are not receiving the messages. Everything is identical to the original tutorial except for adding Windows Authentication. Any ideas what could be my problem? Thanks in advance.
jquery.signalR-2.1.2.min.js
Appears to be a user error. I jumped between the original SignalR tutorial and SignalR with MVC5 tutorial and ran into a discrepancy. Original SignalR tutorial had chat.client.addNewMessageToPage" and the SignalR with MVC5 tutorial "chat.client.broadcastMessage" and I must have botched the copy and paste job between projects and tutorials. Feeling a little sheepish at the moment.

Posting an entry from IBM Social Business Toolkit playground to on premises Connections

I am trying to post entry to community activity stream from IBM Social Business toolkit playground (Domino 9, SBT SDK version 20130602) to on premises Connections install. I am using the playground's existing JavaScript snippets but changed the communityID to match to community UUID in my Connections install. I don't have the OAuth2 configured.
I get an error "Error code:403, message:You are not authorized to perform the requested action."
I am able to get data from Connections. For example "Get Updates From A Community" -snippet works. But I am not able to post anything to Connections.
Do I need a working OAuth2 to be able to post entries or is there something else what prevents posting entries to Connections activity streams?
I tried to add a role to my account according to this post Which J2EE Role need to be enabled to post in the Activity Stream of other user but it did not seem to have an effect.
I was able to get the post entry working. The issue seems to be the browser what I used.
Posting entry did not work with Chrome but with Firefox everything worked as expected. So there seems to be some problems with Chrome and posting entries from the playground. Getting data from Connections works also with Chrome.
Are you prompted for basic authentication (either basic auth or OAuth would would work)? Or are you just accessing public communities?
Can you try to go to the authentication snippets, log in if not already (basic auth),and try the snippet again? If you still have a 403, it might be because your user doesn't have enough rights.

Resources