Announcements
HI Experts,
I'm currently using a third party app (a simple javascript vuejs) build by our services that connect Users (team members licenced) to business central in order to write directly their hours to job journal using Odata.
As you already know, it is not possible for team member to insert usage in job journal.
To workaround this limitation, we did the following that is working fine, using WASK (Web Access Key) to consume OData :
We have an automated login for an Essential Licensed (WASK is stored in app)
and we have another loggin for the team member, whose, after first loggin, the WAK is stored also in the app.
the app is working like this :
Team Member, with his own authentication, is serching for Data that belong to himself (job, job planning lines, quantity etc...)
When team member is recording a usage, on click on "Send", the "Writting" Odata Url is sent using the Project Manager Logging ( Essential User), stored in the application, as said before.
The Project manager is able to post the hours daily using a job journal customization that help to see how many hours had been recorded day by day.
Until now, all is working fine.
I want to add here that this way to work was definitvely extremely efficient. Our user are doing a big amount of micro tasking all day (it can be from 10 to 30).
but now that is coming the OAuth Authentication, I'm wondering if this kind of workaround fond would still be possible.
I cannot imagine now team member access to job journal for inserting data using their project Manager OAuth logging (Essential license)
Thank you for any idea or help.
Hicham
Daniele,
Really perfect, it is working like a charm. Thank you very much for your help.
Hi,
Adding Info.
Regards
Amit Sharma
www.erpconsultors.com
Press Yes if Info is useful
Hi
with the introduction of the Beare Token(OAuth2), authorization to a BC service is no longer tied to a Business central user
the following link will help you better understand:
learn.microsoft.com/.../authenticate-web-services-using-oauth
it is simply a matter of making a double call:
1 - to retrieve the Bearer Token from the app registration to which Business Central is subscribed.
2 - to use the bearer token to invoke Business central's exposed REST Service.
I attach an example:
CAll TOKEN:
method:GET
URL: login.microsoftonline.com/.../token
In the body of the request:
grant_type=client_credentials
client_id= CLient Id app Registration
client_secret=client secret app registration
scope= api.businesscentral.dynamics.com/.default
the call will return you the Beare Token to use in the second call to the business central service:
URL: api.businesscentral.dynamics.com/.../{My Tenant}/{MyEnviroment}/api/v2.0/companies({IDCOMPANY})/items
the Header of the call must contain the following KEYs:
Authorization: Bearer Token - > EXAMPLE(Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSIsImtpZCI6IjJaUXBKM1VwYmpBWVhZR2FYRUpsOGxWMFRPSSJ9)
Content-Type: application/json
Kindest regards,
DAniele
My blog: sites.google.com/.../daniele-incalza
Hello,
I would expect that it will work in a similar way, but you need to rewrite the authentication part. Hope you will receive further suggestions from the hard-core developers available in this forum.
Thank you.
André Arnaud de Cal... 291,359 Super User 2024 Season 2
Martin Dráb 230,370 Most Valuable Professional
nmaenpaa 101,156