marcells / streamdeck-microsoft365

Elgato Stream Deck Plugin for Microsoft 365
MIT License
4 stars 1 forks source link

Office Login: Add account produces invalid_request: #1

Closed TomGuit closed 1 year ago

TomGuit commented 1 year ago

After registering an app in Azure, copy/paste the Azure App ID in Steam Deck Win 10 App. "Add" opens in the browser the https://login.microsoftonline.com/ login page of Microsoft account. When filling the mail of my individual account, a page opens with: invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.

PuffinRub commented 1 year ago

Looks like @TomGuit beat me to it as logging this exact issue has been on my tasks list for a few days. From Azure Active Directory -> App Registrations -> Elgato Streamdeck Plugin for M365 -> Authentication -> Platform Configurations -> Add A Platform -> Web there needs to be a Redirect URI specified to call back to the app, in this case the Stream Deck running locally.

If you run "netstat -b -n" (from an elevated command prompt) then you'll be able to see what port the plugin is currently using by searching for "Elgato.Plugins.Microsoft365.exe"; in my case it was listening on TCP 11067. I set up the redirect URL to point towards it and it completes but no account info is shown in the StreamDeck app afterwards. It may be that TCP 11067 is a red herring or it may be that the API permissions need to be tweaked.

Could @marcells shine some light on this please?

PuffinRub commented 1 year ago

In regards to API permissions, I am guessing that we'll need:

The above from the Microsoft Graph API. Again, I want to specify this is just a guess!

marcells commented 1 year ago

Hey guys,

restricting the permissions is not necessary. The plugin uses the MSAL library for authentication. So it's important to use the Desktop/Mobile authentication Workflow in the app registration. ~The redirect uris should then be created automatically.~

I will provide a more detailed documentation for the app registration, soon.

If you use it for a Microsoft Business account, you or your administrator has to create the app in the portal.

marcells commented 1 year ago

Here we go: https://github.com/marcells/streamdeck-microsoft365/blob/main/docs/CreateAzureApp.md

Please let me know, if there are any issues.

TomGuit commented 1 year ago

Thanks Macell - works like a treat! Thank you a lot for the instruction update! Best regards, Thomas

Marcell Spies @.***> hat am 17.04.2023 22:02 CEST geschrieben:

Here we go: https://github.com/marcells/streamdeck-microsoft365/blob/main/docs/CreateAzureApp.md

Please let me know, if there are any issues.

— Reply to this email directly, view it on GitHub https://github.com/marcells/streamdeck-microsoft365/issues/1#issuecomment-1512004661, or unsubscribe https://github.com/notifications/unsubscribe-auth/A7GMGN7NDMW2IKOGPOQ2DILXBWOULANCNFSM6AAAAAAW7RW5RQ. You are receiving this because you were mentioned.Message ID: @.***>