How to get the register device name from OKTA API - asp.net

I have a requirement to display the OKTA register device name on the screen like the OKTA does for you.
In the picture above it display (Pixel 2 XL) where is the OKTA API to get the register device name
I am referring to OKTA dev API but didn't found anywhere
https://developer.okta.com/docs/reference/api/factors/
Any idea where can I find ???

Once you have the userid you can call the factors list API to get the enrolled MFA factors for the user.
Which will get you back a body like:
[
{
"id": "opffxq5v54xO5kdsa0x6",
"factorType": "push",
"provider": "OKTA",
"vendorName": "OKTA",
"status": "ACTIVE",
"created": "2020-05-07T20:49:49.000Z",
"lastUpdated": "2020-05-20T13:33:58.000Z",
"profile": {
"credentialId": "test#test.com",
"deviceType": "SmartPhone_Android",
"keys": [
{
"kty": "RSA",
"use": "sig",
"kid": "default",
"e": "AQAB",
"n": "j_rlzlG07lZy_TegQPjllleeaGxxDsrtFNaoQHhDowV1z54okXdDobyJo5B9rcCkP7-i0EniNdaCFDj8xugG7WSmcDRzr46AujT7nFVPI5Z7EZE9IaLdYLP0Hg0nRaC3qhHPdv8JGszle8t0Fej1eR-AqT1mrsNUM3-k44_Axj47xhAkIPoxCjyvvA8W1FWKQbECe_y-HtlcLksJlW03WDt_bCdKwx2uVqca1yiEIF3HwhHtpK1dfwosjyEvfpTtsUWtKJVsJiksLajDhu9dGN3JcOT9unsLbWcyWc-kfQ9_oiaMikZCvtbONGSgVjtBttc95-8CHMw-tpA4HCRlcw"
}
],
"name": "Pixel 4 XL",
"platform": "ANDROID",
"version": "29"
},
"_links": {
"self": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6/factors/opffxq5v54xO5kdsa0x6",
"hints": {
"allow": [
"GET",
"DELETE"
]
}
},
"verify": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6/factors/opffxq5v54xO5kdsa0x6/verify",
"hints": {
"allow": [
"POST"
]
}
},
"user": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6",
"hints": {
"allow": [
"GET"
]
}
}
}
},
{
"id": "ostgppjgvFiLfBv850x6",
"factorType": "token:software:totp",
"provider": "OKTA",
"vendorName": "OKTA",
"status": "ACTIVE",
"created": "2020-05-20T13:33:58.000Z",
"lastUpdated": "2020-05-20T13:33:58.000Z",
"profile": {
"credentialId": "test#test.com"
},
"_links": {
"self": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6/factors/ostgppjgvFiLfBv850x6",
"hints": {
"allow": [
"GET",
"DELETE"
]
}
},
"verify": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6/factors/ostgppjgvFiLfBv850x6/verify",
"hints": {
"allow": [
"POST"
]
}
},
"user": {
"href": "https://<yourtenant>.oktapreview.com/api/v1/users/00u9ivp5ft7EHNTRW0x6",
"hints": {
"allow": [
"GET"
]
}
}
}
}
]
The device information is shown under the factorProfile (profile.name) which is documented here but doesn't show an example of push.

Related

Why is watcher giving errors?

I want to send slack notifications to a channel as soon as any log with loglevel ERROR appears in my index. I have configured watcher in the following way but it is giving me errors. The slack message must have the log message.
I am not able to configure this exactly.
{
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index-log*",
"index-beat*"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"match": {
"loglevel": "ERROR"
},
"range": {
"#timestamp": {
"from": "{{ctx.trigger.scheduled_time}}||-5m",
"to": "{{ctx.trigger.triggered_time}}"
}
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"gt": 0
}
}
},
"actions": {
"send_trigger": {
"webhook": {
"scheme": "https",
"host": "hooks.slack.com",
"port": 443,
"method": "post",
"path": "/services/XXXX/XXXX/XXXX",
"params": {},
"headers": {
"Content-type": "application/json"
},
"body": """{ "text": "{{ctx.payload}}"}"""
}
}
}
}
below is the structure of my logs in kibana
{
"_index": "index-beat",
"_type": "_doc",
"_id": "P3Toa34B1LVeuWotaVOY",
"_version": 1,
"_score": 1,
"_source": {
"#timestamp": "2022-01-18T06:38:19.559Z",
"name": "communication",
"loglevel": "ERROR",
"log": {
"file": {
"path": "/home/ubuntu/abc/abc/logs/communication.log"
},
"offset": 0
},
"timestamp": "2022-01-18T06:38:15.384279",
"exception": {
"ex_type": "None",
"ex": "None",
"tb": ""
},
"message": "{'err': 'Test'}"
},
"fields": {
"exception.ex_type": [
"None"
],
"loglevel.keyword": [
"ERROR"
],
"name.keyword": [
"communication"
],
"log.offset": [
0
],
"message": [
"{'err': 'Test'}"
],
"exception.tb": [
""
],
"exception.ex": [
"None"
],
"#timestamp": [
"2022-01-18T06:38:19.559Z"
],
"exception.tb.keyword": [
""
],
"loglevel": [
"ERROR"
],
"log.file.path": [
"/home/ubuntu/abc/abc/logs/communication.log"
],
"message.keyword": [
"{'err': 'Test'}"
],
"name": [
"communication"
],
"exception.ex_type.keyword": [
"None"
],
"exception.ex.keyword": [
"None"
],
"log.file.path.keyword": [
"/home/ubuntu/abc/abc/logs/communication.log"
],
"timestamp": [
"2022-01-18T06:38:15.384Z"
]
}
}
Please help me out in this one.

Can I get the user email within a Velocity template of AWS Amplify?

When I query a resolver in my GraphQL API, in which I have added a $util.error($ctx) to return the context object, I get the following result (removed unnecessary values).
{
"data": {
"listXData": null
},
"errors": [
{
"message": {
"arguments": {},
"args": {},
"info": {
"fieldName": "listXData",
"variables": {},
"parentTypeName": "Query",
"selectionSetList": [
"items",
"items/id",
"items/createdAt",
"items/updatedAt",
"nextToken"
],
"selectionSetGraphQL": "{\n items {\n id\n createdAt\n updatedAt\n }\n nextToken\n}"
},
"request": {...},
"identity": {
"sub": "",
"issuer": "",
"username": "013fe9d2-95f7-4885-83ec-b7e2e0a1423f",
"sourceIp": "",
"claims": {
"origin_jti": "",
"sub": "",
"event_id": "",
"token_use": "",
"scope": "",
"auth_time": ,
"iss": "",
"exp": ,
"iat": ,
"jti": "",
"client_id": "",
"username": "013fe9d2-95f7-4885-83ec-b7e2e0a1423f"
},
"defaultAuthStrategy": "ALLOW"
},
"stash": {},
"source": null,
"result": {
"items": [],
"scannedCount": 0,
"nextToken": null
},
"error": null,
"prev": {
"result": {}
}
},
"errorType": null,
"data": null,
"errorInfo": null,
"path": [
"listXData"
],
"locations": [
{
"line": 2,
"column": 3,
"sourceName": "GraphQL request"
}
]
}
]
}
As you can see, the username is an ID, however I would prefer to (also) have the email. Is it possible to get the user email (within the Velocity template)?
Let me know if I need to add more details or if my question is unclear.
The identity context only returns back the Cognito username for the user pool. You will need to setup pipeline functions to perform additional queries to get your user information. Here is one intro to setting them up.
At this point, it seems that it is not possible to do this purely by vtl.
I have implemented it using a lambda function, as follow:
Lambda function (node):
/* Amplify Params - DO NOT EDIT
ENV
REGION
Amplify Params - DO NOT EDIT */
const aws = require('aws-sdk')
const cognitoidentityserviceprovider = new aws.CognitoIdentityServiceProvider({
apiVersion: '2016-04-18',
region: 'eu-west-1'
})
exports.handler = async (context, event, callback) => {
if (!context.identity?.username) {
callback('Not signed in')
}
const params = {
'AccessToken': context.request.headers.authorization
}
const result = await cognitoidentityserviceprovider.getUser(params).promise()
const email = result.UserAttributes.find(attribute => attribute.Name === 'email')
callback(null, JSON.stringify({ email }))
}
CustomResources.json
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "An auto-generated nested stack.",
"Metadata": {...},
"Parameters": {...},
"Resources": {
"GetEmailLambdaDataSourceRole": {
"Type": "AWS::IAM::Role",
"Properties": {
"RoleName": {
"Fn::If": [
"HasEnvironmentParameter",
{
"Fn::Join": [
"-",
[
"GetEmail17ec",
{
"Ref": "GetAttGraphQLAPIApiId"
},
{
"Ref": "env"
}
]
]
},
{
"Fn::Join": [
"-",
[
"GetEmail17ec",
{
"Ref": "GetAttGraphQLAPIApiId"
}
]
]
}
]
},
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "appsync.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
},
"Policies": [
{
"PolicyName": "InvokeLambdaFunction",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"lambda:InvokeFunction"
],
"Resource": {
"Fn::If": [
"HasEnvironmentParameter",
{
"Fn::Sub": [
"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:GetEmail-${env}",
{
"env": {
"Ref": "env"
}
}
]
},
{
"Fn::Sub": [
"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:GetEmail",
{}
]
}
]
}
}
]
}
}
]
}
},
"GetEmailLambdaDataSource": {
"Type": "AWS::AppSync::DataSource",
"Properties": {
"ApiId": {
"Ref": "AppSyncApiId"
},
"Name": "GetEmailLambdaDataSource",
"Type": "AWS_LAMBDA",
"ServiceRoleArn": {
"Fn::GetAtt": [
"GetEmailLambdaDataSourceRole",
"Arn"
]
},
"LambdaConfig": {
"LambdaFunctionArn": {
"Fn::If": [
"HasEnvironmentParameter",
{
"Fn::Sub": [
"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:GetEmail-${env}",
{
"env": {
"Ref": "env"
}
}
]
},
{
"Fn::Sub": [
"arn:aws:lambda:${AWS::Region}:${AWS::AccountId}:function:GetEmail",
{}
]
}
]
}
}
},
"DependsOn": "GetEmailLambdaDataSourceRole"
},
"InvokeGetEmailLambdaDataSource": {
"Type": "AWS::AppSync::FunctionConfiguration",
"Properties": {
"ApiId": {
"Ref": "AppSyncApiId"
},
"Name": "InvokeGetEmailLambdaDataSource",
"DataSourceName": "GetEmailLambdaDataSource",
"FunctionVersion": "2018-05-29",
"RequestMappingTemplateS3Location": {
"Fn::Sub": [
"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/pipelineFunctions/${ResolverFileName}",
{
"S3DeploymentBucket": {
"Ref": "S3DeploymentBucket"
},
"S3DeploymentRootKey": {
"Ref": "S3DeploymentRootKey"
},
"ResolverFileName": {
"Fn::Join": [
".",
[
"InvokeGetEmailLambdaDataSource",
"req",
"vtl"
]
]
}
}
]
},
"ResponseMappingTemplateS3Location": {
"Fn::Sub": [
"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/pipelineFunctions/${ResolverFileName}",
{
"S3DeploymentBucket": {
"Ref": "S3DeploymentBucket"
},
"S3DeploymentRootKey": {
"Ref": "S3DeploymentRootKey"
},
"ResolverFileName": {
"Fn::Join": [
".",
[
"InvokeGetEmailLambdaDataSource",
"res",
"vtl"
]
]
}
}
]
}
},
"DependsOn": "GetEmailLambdaDataSource"
},
"IsOrganizationMember": {
"Type": "AWS::AppSync::FunctionConfiguration",
"Properties": {
"FunctionVersion": "2018-05-29",
"ApiId": {
"Ref": "AppSyncApiId"
},
"Name": "IsOrganizationMember",
"DataSourceName": "PermissionsPerOrganizationTable",
"RequestMappingTemplateS3Location": {
"Fn::Sub": [
"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/Query.isOrganizationMember.req.vtl",
{
"S3DeploymentBucket": {
"Ref": "S3DeploymentBucket"
},
"S3DeploymentRootKey": {
"Ref": "S3DeploymentRootKey"
}
}
]
},
"ResponseMappingTemplateS3Location": {
"Fn::Sub": [
"s3://${S3DeploymentBucket}/${S3DeploymentRootKey}/resolvers/Query.isOrganizationMember.res.vtl",
{
"S3DeploymentBucket": {
"Ref": "S3DeploymentBucket"
},
"S3DeploymentRootKey": {
"Ref": "S3DeploymentRootKey"
}
}
]
}
}
},
"OrganizationAccessPipeline": {
"Type": "AWS::AppSync::Resolver",
"Properties": {
"ApiId": {
"Ref": "AppSyncApiId"
},
"TypeName": "Query",
"Kind": "PIPELINE",
"FieldName": "listXData",
"PipelineConfig": {
"Functions": [
{
"Fn::GetAtt": [
"InvokeGetEmailLambdaDataSource",
"FunctionId"
]
},
{
"Fn::GetAtt": [
"IsOrganizationMember",
"FunctionId"
]
}
]
},
"RequestMappingTemplate": "{}",
"ResponseMappingTemplate": "$util.toJson($ctx.result)"
}
}
},
"Conditions": {...},
"Outputs": {...}
}
The lambda is created with the CLI and IsOrganizationMember is a regular VTL which has the user email in the $context.prev.result.

Why are my posts content not showing on my admin dashboard?

I have added an application to my WordPress site with a plug in that am using to automatically add posts with a python scripts. My API is working just fine even after testing on postman.
However the post Meta Desc and Key Phrase columns don't show anything as in a post added manually. (See screenshot; the first post is the one added via an api). I will appreciate any idea as to why this is.
post = {
'title': question_title,
'status': 'publish',
"content": question,
"type": "post",
"categories": [2],
"focus_keyphrase": question_title,
}
gradeboosts_url = "https://gradeboosts.com/wp-json/wp/v2"
user = 'aloy'
password = '****************'
creds = user + ':' + password
token = base64.b64encode(creds.encode())
headers = {'Authorization': 'Basic ' + token.decode('utf-8')}
r = requests.post(gradeboosts_url + '/posts', json=post, headers=headers)
A full postman get request that is displaying all columns on wordpress:
response = {
"id": 1692997,
"date": "2021-08-13T12:43:38",
"date_gmt": "2021-08-13T12:43:38",
"guid": {
"rendered": "https://gradeboosts.com/health-sciences-homework-help-3/"
},
"modified": "2021-08-13T12:43:38",
"modified_gmt": "2021-08-13T12:43:38",
"slug": "health-sciences-homework-help-3",
"status": "publish",
"type": "post",
"link": "https://gradeboosts.com/health-sciences-homework-help-3/",
"title": {
"rendered": "Health Sciences homework help"
},
"content": {
"rendered": "<p>Health Sciences homework help. An ion is an atom that has gained or lost one or more electrons.</p>\n<p> I don’t think that this is maths, but more chemistry.<br />\nAn ion is an atom that has a charge due to a lost or gain of electrons. Usually, ions occur when the atom tries to get a full outershell, either by losing electrons (and thus gaining a positive charge) or by gaining electrons (and thus getting a negative charge).</p>\n<p>Health Sciences homework help</p>\n",
"protected": false
},
"excerpt": {
"rendered": "<p>What’s an ion?</p>\n",
"protected": false
},
"author": 2,
"featured_media": 0,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": {
"spay_email": ""
},
"categories": [],
"tags": [],
"yst_prominent_words": [],
"jetpack_featured_media_url": "",
"_links": {
"self": [
{
"href": "https://gradeboosts.com/wp-json/wp/v2/posts/1692997"
}
],
"collection": [
{
"href": "https://gradeboosts.com/wp-json/wp/v2/posts"
}
],
"about": [
{
"href": "https://gradeboosts.com/wp-json/wp/v2/types/post"
}
],
"author": [
{
"embeddable": true,
"href": "https://gradeboosts.com/wp-json/wp/v2/users/2"
}
],
"replies": [
{
"embeddable": true,
"href": "https://gradeboosts.com/wp-json/wp/v2/comments?post=1692997"
}
],
"version-history": [
{
"count": 190,
"href": "https://gradeboosts.com/wp-json/wp/v2/posts/1692997/revisions"
}
],
"predecessor-version": [
{
"id": 1698135,
"href": "https://gradeboosts.com/wp-json/wp/v2/posts/1692997/revisions/1698135"
}
],
"wp:attachment": [
{
"href": "https://gradeboosts.com/wp-json/wp/v2/media?parent=1692997"
}
],
"wp:term": [
{
"taxonomy": "category",
"embeddable": true,
"href": "https://gradeboosts.com/wp-json/wp/v2/categories?post=1692997"
},
{
"taxonomy": "post_tag",
"embeddable": true,
"href": "https://gradeboosts.com/wp-json/wp/v2/tags?post=1692997"
},
{
"taxonomy": "yst_prominent_words",
"embeddable": true,
"href": "https://gradeboosts.com/wp-json/wp/v2/yst_prominent_words?post=1692997"
}
],
"curies": [
{
"name": "wp",
"href": "https://api.w.org/{rel}",
"templated": true
}
]
}
}

Deploying a logic app using ARM templates/powershell

How can I Deploy a logic app that calls a SQL DB stored procedure? I've tried the following action.
"actions": {
"Execute_stored_procedure": {
"conditions": [ ],
"inputs": {
"body": null,
"host": {
"api": {
"runtimeUrl": "https://logic-apis-northcentralus.azure-apim.net/apim/sql"
},
"connection": {
"name": "<sql connection string>"
}
},
"method": "post",
"path": "/datasets/default/procedures/#{encodeURIComponent(encodeURIComponent(string('<stored-procedure-name>')))}"
},
"type": "apiconnection"
}
}
When I deploy this template, the logic app get's created but it's throwing errors or the SQL Connection action is not showing up on the design view. What am I doing wrong here? Is Logic App for calling SQL Stored Proc supported by arm currently?
Here is a sample template for LogicApp ARM template + 'connections' resource
https://blogs.msdn.microsoft.com/logicapps/2016/02/23/deploying-in-the-logic-apps-preview-refresh/
https://github.com/jeffhollan/logicapps-deployments/blob/master/ftp_to_blob.json
I've finally figured this out from #TusharJ links and I'm posting the template I've used below to configure a LogicApp that calls a SQL DB stored procedure in specific intervals.
resources:
[
{
"type": "Microsoft.Web/connections",
"apiVersion": "2015-08-01-preview",
"location": "[resourceGroup().location]",
"name": "sqlconnector",
"properties": {
"api": {
"id": "[concat('subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/sql')]"
},
"displayName": "sqlconnector",
"parameterValues": {
"sqlConnectionString": "<sql db connection string>"
}
}
},
{
"type": "Microsoft.Logic/workflows",
"apiVersion": "2015-08-01-preview",
"name": "[parameters('logicAppName')]",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "LogicApp"
},
"properties": {
"sku": {
"name": "[parameters('workflowSkuName')]",
"plan": {
"id": "[concat(resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('svcPlanName'))]"
}
},
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2015-08-01-preview/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"$connections": {
"defaultValue": { },
"type": "Object"
}
},
"triggers": {
"recurrence": {
"type": "recurrence",
"recurrence": {
"frequency": "Hour",
"interval": 1
}
}
},
"actions": {
"Execute_stored_procedure": {
"conditions": [ ],
"inputs": {
"body": null,
"host": {
"api": {
"runtimeUrl": "[concat('https://logic-apis-', resourceGroup().location, '.azure-apim.net/apim/sql')]"
},
"connection": {
"name": "#parameters('$connections')['sql']['connectionId']"
}
},
"method": "post",
"path": "/datasets/default/procedures/#{encodeURIComponent(encodeURIComponent(string('[dbo].[<Stored Proc Name>]')))}"
},
"type": "apiconnection"
}
},
"outputs": { }
},
"parameters": {
"$connections": {
"value": {
"sql": {
"connectionId": "[resourceId('Microsoft.Web/connections', 'sqlconnector')]",
"connectionName": "sqlconnector",
"id": "[reference(concat('Microsoft.Web/connections/', 'sqlconnector'), '2015-08-01-preview').api.id]"
}
}
}
}
}
}
]
Things may have changed in the API since the previous answer was given. Here is what worked for me as of 10/2016. Note: I used parameters (definitions not shown) for many of the variables:
{
"type": "Microsoft.Web/connections",
"apiVersion": "2015-08-01-preview",
"location": "[parameters('location')]",
"name": "[variables('sql_conn_name')]",
"properties": {
"api": {
"id": "[concat(subscription().id, '/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/sql')]"
},
"displayName": "sql_connection",
"parameterValues": {
"server": "[concat(variables('dbserver_unique_name'), '.database.windows.net')]",
"database": "[parameters('databases_name')]",
"authType": "windows",
"username": "[parameters('databases_admin_user')]",
"password": "[parameters('databases_admin_password')]"
}
}
},
{
"type": "Microsoft.Logic/workflows",
"name": "[variables('logic_app_name')]",
"apiVersion": "2016-06-01",
"location": "[parameters('location')]",
"properties": {
"state": "Enabled",
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"$connections": {
"defaultValue": { },
"type": "Object"
}
},
"triggers": {
"Recurrence": {
"recurrence": {
"frequency": "Hour",
"interval": 1
},
"type": "Recurrence"
}
},
"actions": {
"Execute_stored_procedure": {
"runAfter": { },
"type": "ApiConnection",
"inputs": {
"body": {
"timeoffset": "-4"
},
"host": {
"api": {
"runtimeUrl": "[concat('https://logic-apis-', parameters('location'), '.azure-apim.net/apim/sql')]"
},
"connection": {
"name": "#parameters('$connections')['sql']['connectionId']"
}
},
"method": "post",
"path": "/datasets/default/procedures/#{encodeURIComponent(encodeURIComponent('[dbo].[usp_UpdateHourlyOos]'))}"
}
}
},
"outputs": { }
},
"parameters": {
"$connections": {
"value": {
"sql": {
"connectionId": "[concat(subscription().id, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.Web/connections/', variables('sql_conn_name'))]",
"connectionName": "[variables('sql_conn_name')]",
"id": "[concat(subscription().id,'/providers/Microsoft.Web/locations/', resourceGroup().location, '/managedApis/sql')]"
}
}
}
}
},
"resources": [ ],
"dependsOn": [
"[resourceId('Microsoft.Web/connections', variables('sql_conn_name'))]"
]
}

Open graph fitness.runs returning no data

I have a bunch of Nike+ run data which i'm assuming (based on the below article) is published to the open graph. It certainly looks that way in my timeline.
https://developers.facebook.com/blog/post/2012/08/29/early-success-stories--fitness-and-open-graph/
Frustratingly while my music.listens request works fine and returns all of my Spotify listens, my request for fitness.runs returns no data. Is this simply because Nike haven't integrated correctly with the Open Graph. Or perhaps I need to request extended permissions in my Auth token?
https://developers.facebook.com/docs/reference/opengraph/action-type/fitness.runs
Any ideas?
As with all actions you need the correct permissions, in this case
user_actions.fitness
So the data returned from /me/fitness.runs for Nike will look like
{
"data": [
{
"id": "10101118696330517",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-22T23:15:56+0000",
"end_time": "2013-03-22T23:26:36+0000",
"publish_time": "2013-03-24T15:50:00+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "476811255725972",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587303?external_share_id=CE32E1C4-93D8-48A7-A08F-6D5B4C13EE6A&is_new_meta=true",
"type": "fitness.course",
"title": "1.12 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
},
{
"id": "10101118696155867",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-19T22:03:32+0000",
"end_time": "2013-03-19T22:18:37+0000",
"publish_time": "2013-03-24T15:49:46+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "502469216483599",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587302?external_share_id=EBF6BC1D-BDEA-4EE5-B18D-FBC576610F13&is_new_meta=true",
"type": "fitness.course",
"title": "1.49 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
}
],
"paging": {
"next": "https://graph.facebook.com/13608786/fitness.runs?limit=25&offset=25&__after_id=10101118696155867"
}
}

Resources