Maintain control of your Microsoft 365 data
Post Reply
flavio.santos
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

VBO Registration using APIs (Modern Authentication)

Post by flavio.santos »

Hello Guys,

How can I know when the organization finishes the authentication process on the Microsoft side using APIs?

Veeam application knows when the user finished the authentication, and it changes the message from Waiting for user logon... to You are authenticated to Office 365 as user@domain.com

Image Image

Is there a way to know that using APIs?

Thanks!
Mildur
Product Manager
Posts: 9848
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by Mildur »

This is only the first step to allow veeam to access O365/AzureAD to create the necessary Azure AD App registration and permission. The step is needed to get the authorization token in the background.

After you have allowed the vbo365 server todo that with this „link and code“, the server will create the following permissions for you automatically:

https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50

Here is an example how it can be used by application developers to access the graph API:
https://docs.microsoft.com/en-us/sample ... -api-text/
Product Management Analyst @ Veeam Software
flavio.santos
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by flavio.santos »

I know that Mildur, but how to identify that the user finishes that process using APIs? I mean, in the images above, It's like that I want to automatically click the "Next" button when the user finished the Microsoft code process, but I want to do it in my web portal.

Thanks!
Mildur
Product Manager
Posts: 9848
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by Mildur »

If you have this window, you are in the process to let veeam do it automatically. There is no manual step involved at that time.

If you need todo it manually, you have to create the azure app Registration by yourself outsite of veeam and choose „ Use an existing Azure AD application“ on this screen.
https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50

Image
Product Management Analyst @ Veeam Software
flavio.santos
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by flavio.santos »

Ok, I think I didn't explain all the details. Sorry.

I am not using Veeam Backup Office365 application, I'm using the RestAPIs they offer.

First I use this one to get the device code: https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50

After the user finishes the Microsoft process, I use this one: https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50

But my problem, in the web portal, is how to know that the user finished that? I know that Veeam application has a way to know that, and maybe I can use the same method.

Thanks!
Mildur
Product Manager
Posts: 9848
Liked: 2607 times
Joined: May 13, 2017 4:51 pm
Full Name: Fabian K.
Location: Switzerland
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by Mildur »

I‘m very sorry for misunderstanding you.
With RestFul API, I don‘t have any experience.
Eventually Egor or someone else from Veeam can help.
Product Management Analyst @ Veeam Software
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by nielsengelen »

This is not possible in the current release as the userCode is missing from the API response. We will look into resolving this into a future release but I have no ETA for this.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
flavio.santos
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by flavio.santos »

Sorry nielsengelen, but we have the user code in the response: https://helpcenter.veeam.com/docs/vbo36 ... tml?ver=50

I was wondering if there is any Microsoft API where we can check if the userCode is already associate with our Veeam application.
nielsengelen
Product Manager
Posts: 5797
Liked: 1215 times
Joined: Jul 15, 2013 11:09 am
Full Name: Niels Engelen
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by nielsengelen » 1 person likes this post

Seems I mixed up userCode and deviceCode so let me correct it and explain the logic.

Using the API call you listed, you won't get the correct deviceCode which is required to wait for Microsoft's API to return the correct value when you add an organization. The only place in which this is currently used to simulate the "wait for user" part is when you are performing a login against an already added organization (see my example on GitHub.

The whole Microsoft flow is explained on the Microsoft documentation center and you will see that in the loop part there is a client_id and device_code which is required. It is this device_code which is missing in the VBO API call.

After you do the POST against /v5/Organizations, you'll notice that there are 4 parameters (userCode, verificationUrl, expiresIn, message) but there should be a 5th one called devicecode and that one is missing. You can see this example in action in my blog post.
Personal blog: https://foonet.be
GitHub: https://github.com/nielsengelen
flavio.santos
Enthusiast
Posts: 32
Liked: 4 times
Joined: Nov 26, 2020 3:57 pm
Full Name: Flavio Santos
Contact:

Re: VBO Registration using APIs (Modern Authentication)

Post by flavio.santos »

Thanks, Niels, now I got it.

Let's wait for that parameter in the response. Lol
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests