Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Connect App using Oauth

(0) ShareShare
ReportReport
Posted on by 105

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

  • Verified answer
    Hicham OE Profile Picture
    105 on at
    RE: Connect App using Oauth

    Daniele,

    Really perfect, it is working like a charm. Thank you very much for your help.

  • Suggested answer
    Amit_Sharma Profile Picture
    2,547 on at
    RE: Connect App using Oauth

    Hi,

    Adding Info.

    https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/webservices/authenticate-web-services-using-oauth

    Regards

    Amit Sharma

    www.erpconsultors.com
    Press Yes if Info is useful

  • Suggested answer
    DAnny3211 Profile Picture
    9,278 Moderator on at
    RE: Connect App using Oauth

    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

  • Suggested answer
    Marco Mels Profile Picture
    on at
    RE: Connect App using Oauth

    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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Ramesh Kumar – Community Spotlight

We are honored to recognize Ramesh Kumar as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 2,655

#2
Mansi Soni Profile Picture

Mansi Soni 1,574

#3
YUN ZHU Profile Picture

YUN ZHU 1,453 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans