I am developing a solution for a product and trying to implement C2C connection. I am in stuck with linking SmartThings with my backend via OAuth.
I get request
{
"lifecycle": "CONFIGURATION",
"executionId": "41d224ba-7de3-77ac-fe87-a56fa6f325c3",
"locale": "en",
"version": "0.1.0",
"client": {
"os": "ios",
"version": "1.6.17",
"language": "uk"
},
"configurationData": {
"installedAppId": "7393625f-64d5-42cb-a52f-7935a677c4bb",
"phase": "PAGE",
"pageId": "linkPage",
"previousPageId": "",
"config": {}
},
"settings": {}
}
And return response, that is rendered in SmartThings App:
{
"configurationData": {
"page": {
"pageId": "linkPage",
"nextPageId": "",
"previousPageId": "",
"complete": true,
"name": "Account Linking",
"sections": [ {
"name": "Please, link SmartThings to your XXXXXX account",
"settings": [ {
"id": "linkAccount",
"name": "Link Account",
"type": "OAUTH",
"required": true,
"urlTemplate": "https://xxxxxx.auth.us-east-2.amazoncognito.com/login?response_type=code&client_id=20kucf9dcg5ju9deqeppugqft1&state=7393625f-64d5-42cb-a52f-7935a677c4bb&redirect_uri=https%3A%2F%2Fapi.smartthings.com%2Foauth%2Fcallback"
} ]
} ]
}
}
}
Authentication passes successfully and returns code to callback like that:
https://api.smartthings.com/oauth/callback?code=9dfea1ca-54e8-47e8-ba90-24f20068ad2b&state=7393625f-64d5-42cb-a52f-7935a677c4bb
But the callback returns HTTP 401.
I've read this topic https://community.smartthings.com/t/cloud-to-cloud-oauth-rest-api/118902 and did not find a solution. No more helpful info I could found on the Web.
Has anybody implemented this with success?
The Support is awful - no response for several days.. From my previous Support contacting experience - they can respond after several weeks...
Thank you!
This is a bug of iOS SmartThings application, Android works fine.
https://community.smartthings.com/t/cant-implement-oauth-for-cloud-to-cloud/143258/7
Related
I have created the below webhooks and all are enabled.:
[
{
"contentType": "Audit.AzureActiveDirectory",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
},
{
"contentType": "Audit.General",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
},
{
"contentType": "Audit.SharePoint",
"status": "enabled",
"webhook": {
"authId": "12345",
"address": "https://978b7cfb66d9.ngrok.io/callback/",
"expiration": "",
"status": "enabled"
}
}
]
I don't see any notifications coming when there are changes made in sharepoint. Anything in particular need to change?
From the access token, I do see correct app permissions:
"roles": [
"ServiceHealth.Read",
"ActivityFeed.Read"
]
I manually queried to get content and it shows empty.
https://manage.office.com/api/v1.0/{tenant-guid}/activity/feed/subscriptions/content?contentType=Audit.Sharepoint
Looks like the auditing for Office 365 organization is disabled.
Make sure you turn on audit log search.
We are operating a TFS 2018 Update 2 in our enviroment.
We are sending the example json found here to our server and it is getting accepted successfully:
{
"properties": {
"sampleId": 7,
"customInfo": "Custom status information",
"startedDateTime": {
"$type": "System.DateTime",
"$value": "2017-09-19T14:50:26.7410146Z"
},
"weight": {
"$type": "System.Double",
"$value": 1.75
},
"bytes": {
"$type": "System.Byte[]",
"$value": "dGhpcyBpcyBzYW1wbGUgYmFzZTY0IGVuY29kZWQgc3RyaW5n"
},
"globalId": {
"$type": "System.Guid",
"$value": "1e788cb9-9d3d-4dc6-ac05-822092d17f90"
}
},
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1"
}
But the response doesn't look like in the documentation. Instead it looks like this:
{
"id": 6,
"state": "succeeded",
"description": "Sample status succeeded",
"context": {
"name": "sample-status-1",
"genre": "vsts-samples"
},
"creationDate": "2019-12-11T16:14:05.0574648Z",
"updatedDate": "2019-12-11T16:14:05.0574648Z",
"createdBy": {
"displayName": "...",
"url": "https://.../_apis/Identities/0b85e078-130d-4cb8-a450-17c5c7efccec",
"_links": {
"avatar": {
"href": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
}
},
"id": "0b85e078-130d-4cb8-a450-17c5c7efccec",
"uniqueName": "...",
"imageUrl": "https://.../_api/_common/identityImage?id=0b85e078-130d-4cb8-a450-17c5c7efccec"
},
"targetUrl": "http://fabrikam-fiber-inc.com/CI/builds/1",
"_links": {
"self": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d/pullRequests/58/statuses/6"
},
"repository": {
"href": "https://.../_apis/git/repositories/35fe73eb-7af1-4bba-bf04-545611fcac1d"
}
}
}
The properties are gone. What could be wrong?
Could it be a somehow completely missleading documentation?
To troubleshoot your issue, please check the following items:
Check whether the Status updated on the pull request after running the POST request.
Press F12 in your browser, and send the POST request to check the statuses to see whether you can get properties in the response body.
Check your TFS edition by going to Administration Console -- Application Tier, or checking the About on the web portal. The issue can not be reproduced in TFS 2018.2 on our side.
I'm using Newman in order to execute a POSTMAN collection but I always have the
error "connect ETIMEDOUT". Using just POSTMAN it works fine, but not with NEWMAN.
The testing is quite simple, create a content on the server
https://jsonblob.com/api
I'm following the tutorial
http://blog.getpostman.com/2014/04/17/how-to-write-automated-tests-for-apis-with-postman-part-2/
Thanks you very much in advance. I put below the collection and the enviroment file.
This is the collection:
{
"id": "a6a6b2fe-db11-4c57-9144-6b3324174f18",
"name": "Newman",
"values": [
{
"key": "url",
"value": "https://jsonblob.com",
"enabled": true,
"type": "text"
},
{
"key": "deviceMapping",
"value": "{\n \"content\": \"My first blog post :)\"\n}",
"enabled": true,
"type": "text"
},
{
"key": "blogLink",
"value": "https://jsonblob.com/api/jsonBlob/b7f2ce87-4c8e-11e8-917b-9137e61d314b",
"enabled": true,
"type": "text"
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2018-04-30T16:13:07.630Z",
"_postman_exported_using": "Postman/6.0.10"
}
This is the enviroment file:
{
"id": "a6a6b2fe-db11-4c57-9144-6b3324174f18",
"name": "Newman",
"values": [
{
"key": "url",
"value": "https://jsonblob.com",
"enabled": true,
"type": "text"
},
{
"key": "deviceMapping",
"value": "{\n \"content\": \"My first blog post :)\"\n}",
"enabled": true,
"type": "text"
},
{
"key": "blogLink",
"value": "https://jsonblob.com/api/jsonBlob/b7f2ce87-4c8e-11e8-917b-9137e61d314b",
"enabled": true,
"type": "text"
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2018-04-30T16:13:07.630Z",
"_postman_exported_using": "Postman/6.0.10"
}
Fixed: It was a proxy matter. I wrote these two commands in the cmd console:
set HTTPS_proxy=myuser:mypassword#ipoftheproxy:portoftheproxy
set HTTP_proxy=myuser:mypassword#ipoftheproxy:portoftheproxy
It was a proxy issue for me, I added my organization specific proxy in Postman settings and it worked.
Fixed by change the proxy protocol
For Mac User
Go to Settings -> Network -> Advanced -> Proxies
Tick "Auto Proxy Discovery"
Click "Ok"
Click "Apply"
Restart Postman
Another way:
Go to Postman Settings
Set SSL certificate verification to off
Let me know if you found any issue
I'm evaluating atlassian-connect-express and just created an app
boilerplate with "atlassian-connect new", and then deployed it via ngrok
to my Jira dev account.
That works fine, but when I try to use the file "credentials.json" with
my account data, the plug starts with the error message:
Failed to register with host https‍://michael%40...:[My
password]#connect-ace.atlassian.net (401)
Add-on not registered; no compatible hosts detected
I get a similar message when I go to the url connect-ace.atlassian.net
Here my atlassian-connect.json
{
"key": "my-add-on",
"name": "Ping Pong",
"description": "My very first add-on",
"vendor": {
"name": "Angry Nerds",
"url": "https://www.atlassian.com/angrynerds"
},
"baseUrl": "https://xxxxxxx.ngrok.io",
"links": {
"self": "https://xxxxxxxx.ngrok.io/atlassian-connect.json",
"homepage": "https://xxxxxxx.ngrok.io/atlassian-connect.json"
},
"authentication": {
"type": "jwt"
},
"lifecycle": {
"installed": "/installed"
},
"scopes": [
"READ"
],
"modules": {
"generalPages": [
{
"key": "hello-world-page-jira",
"location": "system.top.navigation.bar",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
},
{
"key": "hello-world-page-confluence",
"location": "system.header/left",
"name": {
"value": "Hello World"
},
"url": "/hello-world",
"conditions": [{
"condition": "user_is_logged_in"
}]
}
]
}
}
and my credatials.json
{
"hosts": {
"connect-ace.atlassian.net": {
"product": "jira",
"username": "michael#---",
"password": "---password---"
}
}
}
How can I get my dev account working with connect-ace?
Two things to check:
1 - Check the if the credentials.json has correct values. host url should start with https://. Password is the api token generated from here.
{
"hosts": {
"https://<your atlassian site name>.atlassian.net": {
"product": "jira",
"username": "<jira user name>",
"password": "<Token created from https://id.atlassian.com/manage/api-tokens>"
}
}
}
2- Enable development mode at Settings -> Apps -> Manage Apps -> Settings. (This is required if the app is not published in marketplace)
This error is a default from atlas-connect
Print error image
In atlasssian-connect.json
replace this :
"lifecycle": {
"installed": "/installed"
},
for this:
"lifecycle": {
"installed": "installed"
},
Have you tried spawning your own cloud instance and testing it there? If not yet, try creating one here. Once successfully registered, in your credentials.json, change "connect-ace" with your baseUrl/sitename and with the right credentials, it should automatically install it for you.
After deploying AWS API Gateway via CLI (using put-rest-api and create-deployment) I want to do some testing of my API description in Postman.
After exporting the API via AWS Console (MyAPI - Stages - MyStage - Export - Postman) no body content is imported to Postman.
Does anyone know how to solve this?
When you export with postman extensions, the swagger file contains the definition of the model and the fact that its a parameter to POST, but postman does not show it in content. This is how postman import works. There is a feature request for this in gihub https://github.com/postmanlabs/postman-app-support/issues/1235
...
"/": {
"post": {
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"parameters": [
{
"in": "body",
"name": "TestModel",
"required": true,
"schema": {
"$ref": "#/definitions/TestModel"
}
}
],
...
"definitions": {
"TestModel": {
"type": "object",
"properties": {
"photos": {
"type": "object",
"properties": {
"page": {
"type": "integer"
},
"pages": {
"type": "string"
}
...
}
}
},
"title": "TestModel"
}
}
}