fuel9 / DisplayMonkey

Display Monkey digital signage solution
Other
126 stars 50 forks source link

EWS login not authorized - Account name #34

Open Zasig opened 6 years ago

Zasig commented 6 years ago

EWS is only accepting the "User logon name" as login name. Display Monkey demands "username@contoso.com" as Account Name. Is there a way to display monkey accept the "User logon name" without the mail domain?

ralsgard commented 6 years ago

I have found a workaround. First i create and connect an Outlook.com account. Then i manually edit the sql table "ExchangeAccount" and set my Exchange parameters. 1 Exchange nn\username 5 https://owa.mycompany.com/EWS/Exchange.asmx Its important that you use the same password for your Outlook account and the Exchange account since you cant edit it manually in sql table.

psined1 commented 6 years ago

Hi, this use case seems a bit unorthodox. If your Exchange account is hosted by Outlook.com, your login should be decorated with domain suffix. Could you please elaborate further - "First i create and connect an Outlook.com account"?

ralsgard commented 6 years ago

:), the Outlook.com account I only used to be able to set an account with password. Since the admin tool only accepts user in the format username@company.com and not nn\username (I don´t know any other way to enter the password in database. When this is done I have a record in the database with username and password - now I can change this record manually in db to my Exchange server details and username I can set to nn\username

psined1 commented 6 years ago

You didn't specify - is your mailbox hosted in Outlook.com or you have an on-prem Exchange server? Either way, it should be possible to register account using the email pattern rather than AD pattern. The mere fact, that you are able to register EWS account in DMM application settings implies this should work without needing you to fix it in SQL.

Also, you have never stated what's your real problem - are you getting an error of some sort, or else why do you need to dabble with the database table?

ralsgard commented 6 years ago

I use on -prem Exchange server. I have the same problem as Zasig - Display Monkey demands "username@contoso.com" Our Exchange infra doesnt accept this - only domain\username

psined1 commented 6 years ago

From what I understand it should be easily possible to configure EWS to accept both UPN and SAM decorated logins - check this link

Zasig commented 6 years ago

I'm sorry for the late answer. Had some stuff to do and forgot it. I'm looking into this and head back with the outcome. Thanks anyway!

Zasig commented 6 years ago

@ralsgard i tried it your way and it's working with the outlook.com account. As soon as i change it to the domain\username credentials in the db, i only get an error on the display

{error: the object of typ \\system.dbnull\\ cannot be changed/switched into type \\system.byte[]\\. ,Data:{FrameId:0,PanelId:2,DisplayId:2}} (translated from german)

@psined1 I checked your solution, but for EWS i cannot change the setting to accept "username@contoso.com"

For OWA i can easily tick Forms-based authentication and set it to UPN. But EWS is not providing that option.

So either DM is changing the accepted input, or i need help from ralsgard getting the workaround running

ralsgard commented 6 years ago

I'am not sure I can help. the error doesn´t mean anything to me.... We have local Exchange 2013 servers and my DM settings in DB looks like this

AccountID: 2 Name: Company Account: nn\username Password: ***** (must be the same on local account and Outlook.com) EWSVersion: 5 URL: https://owa.company.com/EWS/echange.asmx

Zasig commented 6 years ago

Hm ok. What is that account? Is it a default ressource mailbox? Are you using the room mailbox, or a different account which has full access to the calender?

ralsgard commented 6 years ago

its a different account with full access

Zasig commented 6 years ago

and "nn\" is your "User logon name (pre-Windows 2000)"?

ralsgard commented 6 years ago

nn is the domain name

Zasig commented 6 years ago

Don't know what it is, but it's not working. Seems to be some kind of DB problem. I tried: contoso\user user and our pre-Windows 2000 Domain name "adbf\user"

Same error all the time. Which version are you using or are you using a different DB? Accessing the EWS page with a browser and the given information is working

ralsgard commented 6 years ago

Since it works when you connect to Outlook.com, i Think db is ok. I use SQL 2016. and yes you should use pre windows 2000 like adbf\user and this account should have full access to rooms When i had the system working with Outlook.com, I only changed Account and URL in DB. Don´t touch the password field (and make sure you have the same password on your Outlook.com account and adbf\username.

Zasig commented 6 years ago

I think i found it. I used SQLDataEdit, small programm for db editing. After i edited the username, the password field was NULL. I'm using MSSQLServer Studio now to change the field.

Zasig commented 6 years ago

Ha! It's working now! Thank you.

Zasig commented 6 years ago

Result: ralsgard workaround is working good. Since Exchange 2016 EWS cannot be (from what i found) configured to work with the credentials DM is needing, the workaround is a good option.

But this problem should be considered for Exchange 2016 compatibility issues.

psined1 commented 5 years ago

Re-opened as possible enhancement