-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oauth Authorization Fails with most recent code #1
Comments
I'm in Jamaica on vacation. Do you have the panel device in smartthings Only thing that comes to mind while sitting on the beach
|
Indeed I do. Even with this one line commented out, I was able to fire I'll keep tinkering unless you have any other suggestions, otherwise I
Sent with Postbox http://www.getpostbox.com |
I do notice that I'm getting one error in my node output, as well as in the log for smartthings. Node output:Partition 10 is Armed ST Output:9808b4d8-eb95-4858-a476-24c7de932eXX 12:28:50 PM: debug It was a partition... armed... 0 on Home Hub via sendHubCommand |
Forgot the important line in the ST output, whoops! Its marked as a red error. 9808b4d8-eb95-4858-a476-24c7de932eXX 12:28:50 PM: error java.lang.NullPointerException: Cannot invoke method latestValue() on null object @ line 270 |
Any fixes for this? I'm having the same error "Authorizing the selected devices failed; please try again later or contact support" after creating the smart app. After selecting a location no devices show up to authorize.. Note: Seems like "panel" variable is null in installed() suscribe(panel).. where is that supposed to come from? |
@javier-jimenez I just updated the repo, try that and let me know if it works |
Seems like nulls are not the reason for this (already added those null checks too).. I'm getting this error in the live log after clicking "Authorize" along with the "Please select at least one device to authorize" since no devices show after selecting a location: grails.validation.ValidationException: Validation error whilst flushing entity [physicalgraph.app.InstalledSmartApp]:
Update: After adding an extra section clause in the preferences (outside the page clause) to bypass the "Please select at least one device to authorize" error I now see the devices but when clicking Authorize I get this, I'm new with this.. how can we request the stack traces for this error? I see nothing in the live logs: Oh No! Something Went Wrong! Error |
@javier-jimenez Sorry for the delay... To this point I haven't modified my own configuration (since it's working) but I understand they may have changed things since I did my initial setup. I see exactly what you're talking about now.
Once you finish adding your devices in the mobile app, in the live log it should spit out something like this: That's your app id (the part after I'll update the readme in the next couple of days |
@oehokie I already tried that app id/token combination, it gives a 500 status error in the AlarmServer. Also using that URL directly in the browser gives this: Doing a GET or POST request to https://graph.api.smartthings.com/api/smartapps/installations/APP_ID/panel/zoneupdate?access_token=APP_TOKEN (where APP_ID and APP_TOKEN are the ones I got from the log) gives me: HTTP 500 - Cannot get property 'authentication' on null object |
Hmm... when I do a GET to the home url, I get this as a response:
|
Clarification, that was just pasting the URL into the browser. I get the same message with my working version, so that's a good sign at least |
@javier-jimenez do you get the same? maybe it's more of an issue with your node setup? |
The app.js application throws that same 500 error too, is your node app doing this same kind of requests? This is the request URL that the app.js is doing: Try that in the browser (or POST with POSTMAN) replacing APP_ID and APP_TOKEN with your ID and token, do you get the same 500 error? If you do, why is your node app not complaining? |
Ok I finally fixed it, I forced a createAccessToken() to generate a new access token and that seems to be working fine, no more 500 status errors! I would recommend adding a section in the preferences so we can authorize this using the /oauth URL and then copy the ACCESS TOKEN from the live log as you mentioned: preferences { Thanks! |
@javier-jimenez The original intention was to get rid of the OAuth process. One of the SmartThings Dashboard projects uses a similar method, where you install the SmartApp and it handles everything / spits out the code for you to use with your own server. I'll see if it can be an either / or deal. |
Hi Matt,
Ive been trying to get this installed, and was having no luck getting the SmartThings developer interface to authorize my OAuth request - it kept failing with "Authorizing the selected devices failed; please try again later or contact support" until I commented out the subscribe(panel) in the updated() definition:
https://github.com/oehokie/SmartDSC/blob/master/smartapp/dscAlarmIntegrationSmarththingsApp.groovy#L109
I presume that by commenting this out, it will break something, but by commenting it out it allows the authorization to happen and I can proceed.
This URL came up when searching, leading me to attempt commenting out various subscribe/unsubscribe combos: http://community.smartthings.com/t/is-oauth-broken/13284/6
So far this is the minimum amount of code altering Ive found that produces a successful authorization, would love to hear your feedback!
Dayton
The text was updated successfully, but these errors were encountered: