Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Possible problem with Smart Connect login using oauth2

SmartConnector Forum

Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • SmartConnector
  • SmartConnector Forum
  • Possible problem with Smart Connect login using oauth2
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
JeffBowman
Sisko JeffBowman Sisko
164
ardak
ardak Schneider Alumni (Retired)
34
sesa180908_brid
Commander sesa180908_brid Commander
34
mike_meirovitz
Commander mike_meirovitz
21
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to SmartConnector Forum
Anonymous user
Not applicable

Posted: ‎2017-02-24 05:35 AM

0 Likes
25
4399
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 05:35 AM

Possible problem with Smart Connect login using oauth2

I'm using the swagger UI to view and test REST api (planning on writing a client to utilize it).

During testing, it seems that the oauth2 token will expire in a relatively short period, and then you must login again.

This would be fine, but attempting to login a second time often fails, with an error message:

"The User Name or Password were incorrect"

I thought it was just a problem with the UI, but in checking the chrome console, I'm seeing the correct password is in fact sent, indicating a problem with the MongooseEwsRestProvider endpoint

I've blurred it out, but I can assure you the correct password is in the form data.

Additionally, I've noticed that the same oauth token is given with each unique session.  (I don't know how oauth2 works, but at least in basic/digest auth, the token is usually unique per session, so perhaps this is related to the problem I'm seeing).

EDIT: on closer observation, the token is unique per session, they just have a lot of characters in common at the beginning.

Tags (6)
  • Tags:
  • authentication
  • login
  • oauth2
  • rest
  • smartconnect
  • token
Reply
  • All forum topics
  • Previous Topic
  • Next Topic
Replies 25
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-24 06:34 AM

0 Likes
24
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 06:34 AM

A couple of things first.

  • From the looks of your captures, you are probably using the SoapEwsRestProvider (used for SBO etc) class not the MongooseEwsRestProvider (which is for a native SmartConnector EWS Servers).  Regardless, the OAuth interaction with Swagger would be identical.
  • The time the Bearer Token is valid is entirely within your control.  By default it is 5 minutes but you can change the value in the Endpoint Configuration (see Http Configuration => Access Token Time Span Minutes).
  • At the present time, SmartConnector doesn't utilize OAuth refresh tokens although you could always request a new token at any time.

I've tested what you are reporting and cannot replicate the issue.  My test was as follows (I was also using Chrome):

  1. Configure a SoapEwsRestProvider backed by SBO (both running locally in my test bed).
  2. Set the configuration Access Token Expire Time Span Minutes to 1 minute.
  3. Start the Endpoint
  4. Open Swagger
  5. Authenticate with valid credentials.  Observe acceptances of credentials.
  6. Execute GetRoot.  Observe valid response.
  7. Wait until token expires
  8. Execute GetRoot.  Observe "Message": "Authorization has been denied for this request." response.
  9. Click Login again.  Observe page reload.
  10. Execute GetRoot.  Observe valid response.

I've done the above with Fiddler open and not and with the Chrome debugger open and not.

Perhaps there is something else going on here.

Are you connecting to an an ES or an AS?

What version?

Where is SBO in relation to SmartConnector (i.e. is it co-located on the same physical machine)?

Are there any other proxy servers at play?

Can you provide a screen shot of your Endpoint Configuration (please expand the Http Configuration node)?

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 06:54 AM

0 Likes
23
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 06:54 AM

You're right, it's SoapEwsRestProvider, not Mongoose:

Here is my Provider config and details:

and I'm connecting it to an ES on the same host:

The problem has been intermittent for me, but it happens often enough that it could be of some concern.

my steps are pretty much the same as yours:

1) login with username and password

2) send a request for GET /Root

3) send a request for GET /Containers/{Root.id}/Children

4) send a request for GET /Values/{Test.id}

5) wait for token to expire

6) attempt another GET /Values/{Test.id} (receives expected 401 response)

7) click the login button (sometimes it works, and sometimes i get an alert stating wrong username and password)

Reply
JeffBowman
Sisko JeffBowman Sisko
Sisko

Posted: ‎2017-02-24 07:45 AM

0 Likes
22
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 07:45 AM

Hi Josh,

Is there any way you could turn on SmartConnector logging on to maybe see if we can see what is happening here?

In Service Settings set the 'Logging Level' to TRACE and in the Logging Filters turn on 'Ews Consume' and 'Rest Serve'.

If you can get us a log file with these settings on and this happening, this might shed some light onto what is happening.

Regards,

-Jeff

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 08:03 AM

0 Likes
21
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:03 AM

I'm willing to give that a try.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 08:15 AM

0 Likes
20
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:15 AM

okay, I've enabled TRACE logging and Consume/Serve filters, but I'm not sure where to retrieve the logs.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-24 08:16 AM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:16 AM

Logs are stored in C:\ProgramData\SmartConnector\Logs

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-24 08:18 AM

0 Likes
18
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:18 AM

You can email them to me.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 08:30 AM

0 Likes
17
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:30 AM

alright, I sent you the log file.  I was able to replicate the problem during the last few minutes of logging.

I also observed something I haven't seen up until now.  it may be a separate issue:

when I requested /Root after the expiration (via the 'Try it out!' button), instead of the expected 401 Unauthorized, I received a 500 Internal Server Error, with data:

{"Message":"The underlying connection was closed: The connection was closed unexpectedly."}

a second try got the expected 401 response.

after that, I clicked login, and got the 400 (bad request), with data:

{"error":"invalid_grant","error_description":"The User Name or Password were incorrect."}

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-24 08:51 AM

0 Likes
16
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 08:51 AM

I see that in the logs but I'm not seeing any Rest Serve entries.  I think you turned on EWS Serve instead because I am seeing calls to the SmartConnectorWeatherService sample server.

Can you turn OFF Ews Serve and turn ON Rest Serve and resend me the logs.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 09:38 AM

0 Likes
15
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 09:38 AM

Looks like you're right... Sorry about that.  I'll email you the correct logs in a moment.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 10:34 AM

0 Likes
14
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 10:34 AM

I'm having trouble replicating the problem now that Rest Serve logging is enabled.  I'm going to try turning it back off and see if it increases the chances of seeing the problem again.  Very strange...

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 12:53 PM

0 Likes
13
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 12:53 PM

Unfortunately, I can't seem to consistently replicate the problem anymore.  I have been able to test my REST client against it, and it seems to be working for the time being...

I've reenabled the logging for Rest Serve,
and I'll report back with those logs if the problem arises again.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-24 12:57 PM

0 Likes
12
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 12:57 PM

For future reference, what version of SBO are you using?

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-24 01:13 PM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-24 01:13 PM

SBO 1.8.1.79

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 07:02 AM

0 Likes
10
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 07:02 AM

I may have replicated the problem (or similar to it) this morning.  I sent you another email containing the logs.  It should contain both Ews Consume and Rest Serve logs, and is now excluding Ews Serve logging.

Hopefully it helps identify the problem.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-27 07:14 AM

0 Likes
9
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 07:14 AM

The only thing that the log files show is that the server (SBO) is terminating the connection.  This can occur if SBO has exhausted it's pool of available client connections. 

Do you have other EWS clients which are hitting the same endpoint?

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 08:14 AM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 08:14 AM

Should I be looking for too many clients attempting to connect to the ES,

or too many clients attempting to connect to the SmartConnector/REST endpoint?

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 09:15 AM

0 Likes
7
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 09:15 AM

This is my best approximation of our network configuration right now.  I don't see anything that would obviously be consuming all of the ES or REST endpoint connections at present, and wireshark capture on ports 8082, 8083, and 808 isn't showing a lot of activity.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-27 11:42 AM

0 Likes
6
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 11:42 AM

This issue is similar in symptoms to a known issue which is documented in the SmartConnector release notes (See Bug #348).  The only difference is that the issue has only been reported when the communication between SmartConnector and SBO is over TLS.

In order to determine if this issue is the similar, we will need a Wire Shark capture which demonstrates the issue.

Also, from your diagram the EWS server which is supplying data to the REST endpoint (local 1.8 ES on 808) is also serving EWS to a remote client (.52 1.8 ES) and consuming EWS (local 1.7 ES on 807) and SC Weather project (localhost 5300).  You should consider disabling this other communication until we determine where the root cause is.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 11:46 AM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 11:46 AM

Okay, I'll go ahead and disable those other communications, and I will attempt to capture the problem in wireshark, as well as a an example of a successful communication.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 12:25 PM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 12:25 PM

alright, I've emailed the wireshark capture.  contains several failed attempts to POST /GetToken, and finally a successful attempt.

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-27 12:48 PM . Last Modified: ‎2023-02-05 10:10 PM

0 Likes
3
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-27 12:48 PM

The capture looks characteristic of a similar problem I was observing earlier, when attempting to login directly to Ews via Soap UI:

Problems with EcoStruxureware on loopback​

 

For me, the problem only occurs on loopback, and the wireshark capture shows a 'Connection Reset' response immediately following the client's attempt to respond to the digest challenge with username and password.

 

Hopefully this additional information of of use

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-02-28 08:44 AM

0 Likes
2
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 08:44 AM

Josh,

From analyzing the captures, the symptoms you are experiencing are very similar to the those that had formerly only been reported when SmartConnector consumed EWS from SBO over TLS (HTTPs).  We believe the root cause is due to SBO issuing a TCP RST immediately after the expected 401 response during the HTTP Digest authentication handshake.  This behavior, while technically acceptable under RFC 7230, is known to potentially cause issues for clients. 

We've updated the EwsClient class in SmartConnector so that it will be more tolerant of this condition.  This update is now available as a beta (v2.2.125) from SmartConnector Server.  You should have access to this beta download now if you wish to try this version. 

Reply
Anonymous user
Not applicable

Posted: ‎2017-02-28 10:36 AM

0 Likes
1
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-02-28 10:36 AM

thanks! glad to hear that.  I will checkout the beta as soon as I can get around to it.

Reply
sesa180908_brid
Commander sesa180908_brid Commander
Commander

Posted: ‎2017-03-08 07:18 AM

0 Likes
0
4222
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2017-03-08 07:18 AM

Josh,

v2.2.127 has been posted to smartconnectorserver.  This version contains the patch that will address the issue you experienced.

Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of