Universal link configurations issue - swift

I'm dealing with universal link issue for the past few days and I can't understand why it's not working.
sorry can't show the domain, so I show it as myDomain.nl
we uploaded the apple-app-site-association
https://myDomain.nl/.well-known/apple-app-site-association
and here are the contents
{
"applinks": {
"apps": [],
"details": [
{
"appID": "5LKNOW4KJS.app.appname.com", // teamID.app bundle identifier
"paths": ["*"]
}
]
}
}
And in the Xcode in the Associated Domains I added
applinks:myDomain.nl
The issue is simple, it will not open the app when myDomain.nl run on safari
I also tried to search for swdc the mac console on the iPhone device, but I found nothing, the logs will be completely empty after searching swdc
would be so appreciated if anyone help me what is the issue here.
Here are more details
I validated the AASA with here
And
"associated domains” capability is enabled for the app
I tested this process both from installed app from Xcode and TestFlight
The appID in my AASA includes two part -> 1- Team ID from Apple developer platform (see second image) and 2- app bundle identifier from Xcode
teamID.appBundleIdentifier
I also run in Terminal
martin#martins-MacBook-Pro ~ % curl --http1.1 -i https://myDomain.nl/.well-known/apple-app-site-association
HTTP/1.0 200 Found
cache-control: no-cache
content-type: application/json
{
"applinks": {
"apps": [],
"details": [
{
"appID": "5LKNOW4KJS.app.appname.com",
"paths": ["*"]
}
]
}
}

That third-party AASA validator (https://branch.io/resources/aasa-validator/) is reporting a ≥400 status code. That will prevent the universal links from working. Try opening https://yourdomain.nl/.well-known/apple-app-site-association from curl or a web browser, and see precisely what status code you receive.
Until this error is resolved, universal links will not function correctly. Once you have resolved that AASA server configuration issue, if it is still not working with TestFlight (or ad hoc) archive builds, then review the rest of the configuration (e.g., the implementation of the necessary methods in the app/scene delegates, etc.).
For more information, see See Supporting universal links in your app and Universal Links for Developers.
Once you have enabled developer mode on your device, you can diagnose universal links in “Settings” » “Developer” » “Universal links” » “Diagnostics”:
From your macOS console, you can also diagnose links on a device by monitoring swcd events from the Console app, and search for “beginning data”:
And once you see the identifier, you can see all events associated for that particular universal link:
And you can generate a sysdiagnose on your device and then look at the swcutil_show.txt:
Service: applinks
App ID: …
App Version: 302.0
App PI: <LSPersistentIdentifier 0x6e68185d0> { v = 0, t = 0x8, u = 0x16c8, db = 02350E0B-B10A-4D51-9FFD-F57CA687CF17, {length = 8, bytes = 0xc816000000000000} }
Domain: …
Patterns: {"/":"*"}
User Approval: unspecified
Site/Fmwk Approval: approved
Flags:
Last Checked: 2023-01-15 19:08:53 +0000
Next Check: 2023-01-20 18:15:34 +0000
See https://youtu.be/xxyEq_ySoO4.

Related

Error - Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity

I am connecting an On-premise S/4 HANA with SAP Cloud Platform trial account. I am using SAP Cloud SDK to fetch all Business Partners from S/4 HANA.
My Cloud Connector is set
My Destination at Sub-Account level is set and can ping to my on-premise system
My Service instances - XSUAA/Destination/Connectivity is set with the application
But I have the following error
Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity: no JWT bearer found in the 'Authorization' header of the request. Continuing without a header. Connecting to on-premise systems may not be possible
The code which I am using is -
final List<BusinessPartner> businessPartners =
new DefaultBusinessPartnerService()
.getAllBusinessPartner()
.select(BusinessPartner.BUSINESS_PARTNER)
.execute(destination);
It seems AppRouter is the recommended for Authorization and Access and hence I tried implementing one- but my approuter shows - Not Found
Approuter App -Name - approuter-demo
Below is the xs-app.json
{
"routes": [
{
"source": "^/s4ext/(.*)",
"target": "/s4ext/$1",
"destination": "******"
}
]
}
The Manifest file is as below:
---
applications:
- name: approuter-demo
routes:
- route: approuter-demo-*****trial.cfapps.eu10.hana.ondemand.com
path: approuter
memory: 128M
env:
TENANT_HOST_PATTERN: 'approuter-demo-(.*).cfapps.eu10.hana.ondemand.com'
destinations: '[{"name":"******", "url" :"https://s4ext-***.cfapps.eu10.hana.ondemand.com", "forwardAuthToken": true }]'
services:
- xsuaa-demo
- connectivity-demo
- destination-demo
Kindly guide me. Thanks.
Your destination type might be wrong. The authorization header is set via the destination.
Try other types in sap cp -> connectivity.
Reading your question again I can identify two issues:
This error message in your log:
Failed to add 'SAP-Connectivity-Authentication' header for on-premise connectivity: no JWT bearer found in the 'Authorization' header of the request. Continuing without a header. Connecting to on-premise systems may not be possible
It may be that this error message is actually superfluous and hence indicating a problem which is actually none. In your case this header is possibly not necessary and the SAP Cloud SDK should not try to add it. But in any case, this will not influence the actual connection, so this error message is at most confusing, but not harmful in the sense of altering functionality.
Still, I am asking you to add the stack trace of this exception to your question to be very sure here.
Your app router shows "Not Found":
Here I am missing more information. When does what exactly show "Not Found"? Is it that your browser cannot find your app router, or can your app router not find the target URL of the application?

Is Universal link work on HTTP server?

Guys, just want to know whether Universal link can work with HTTP website instead of HTTPS.
If i use universal links in www.mydomain.co.id/match/play_2.html
Entitlement setting is applinks:kumpul.co.id right? But for the apple-app-site-association, i upload it to http://www.mydomain.co.id ,
{
"applinks": {
"apps": [],
"details": [
{
"appID": "[TeamID].id.co.mydomain",
"paths": [ “match/*”]
}
]
}
}
so the location will be http://www.mydomain.co.id/apple-app-site-association. Is it the right configuration ?
3.For debugging information, how could i see my log in iphone when debugging via Xcode to check my code is correct? because when i click links from Whatsapp for example, i can't see the the log in my console
Universal Links URLs can be either http:// or https://. However, the apple-app-site-association file MUST be served over HTTPS otherwise iOS will refuse to scrape it.
This scraping happens only when the app is first installed, and during updates installed from the App Store. Not for every link open. If the scraping attempt fails, you will see an error like this in the OS-level (not App-level in Xcode) logs:
Sep 21 14:27:01 iPhone swcd[2044] <Notice>: 2015-09-21 02:27:01.878907 PM [SWC] ### Rejecting URL 'https://examplecustomdomain.com/apple-app-site-association' for auth method 'NSURLAuthenticationMethodServerTrust': -6754/0xFFFFE59E kAuthenticationErr

How Do I Change The Project Owner Using REST API

I want to change the project owner of a project using REST API. I know there is a "/Owner" endpoint and I can get the owner without any problems with the following GET:
site/_api/ProjectServer/Projects('2cc734f2-cd16-4f09-8632-a2bc74a32577')/Owner
So how do I change the project owner using REST API?
This is an old issue but I figured it might help someone since I recently struggeled with this too.
I have only tested this on Project Online and not on-prem, probably works the same on Project Server 2016
Start by checking out the project
Send a PATCH request to:
_api/ProjectServer/Projects('PROJECT ID')/Draft
with the following headers:
Accept: application/json; odata=verbose
Content-Type: application/json; odata=verbose
X-RequestDigest: The request digest
If-Match: Either "*" or the etag value you get from checking out the project
and the request body:
{
"__metadata": {
"type": "PS.DraftProject"
},
"OwnerId": "SharePoint User ID of the owner"
}
It's important that you send the "OwnerId" value as a string, not a number.
Publish the project
The general way to change site owners using REST API according to MSDN is:
POST http://<sitecollection>/<site>/_api/site/owner
So in your case you should just have to change from a GET command to POST

GET request using Azure app services and Intel Edison

I wanted to read data from an azure app service's easy tables using REST API to an Intel Edison. Before I did the same using Azure Mobile Services and my code was this. PS: I'm programming the device by the Arduino IDE.
void send_request()
{
Serial.println("\nconnecting...");
if (client.connect(server, 80)) {
// POST URI
sprintf(buffer, "GET /tables/%s HTTP/1.1", table_name);
client.println(buffer);
// Host header
sprintf(buffer, "Host: %s", server);
client.println(buffer);
// Azure Mobile Services application key
sprintf(buffer, "X-ZUMO-APPLICATION: %s", ams_key);
client.println(buffer);
// JSON content type
client.println("Content-Type: application/json");
client.print("Content-Length: ");
client.println(strlen(buffer));
// End of headers
client.println();
// Request body
client.println(buffer);
}
else {
Serial.println("connection failed");
}
}
where server name was "genesis-iot-control.azure-mobile.net";
but now authentication has changed and mobile service has been replaced by app service. How can I access them using REST API on Intel Edison?
I had followed this lead but with no solutions.
Any kind of help is appreciated.
The Application Key mechanism has been removed from Mobile Apps.
You'll need to implement-your-own-header check.
See this article for more:
https://github.com/Azure/azure-mobile-apps-net-server/wiki/Implementing-Application-Key
In essence, you send a X-YOUR-CUSTOM-HEADER: SeCreT= from your Edison and check its value against an Application Setting (defined in the Portal) in your Node/C# Mobile App backend code.
Yes, they should have kept the old mechanism going, disable it by default but allow us to turn it back on with an application setting.
An alternative to that would be to either get a Bearer token from Azure AD and use that with Authorization: Bearer ToKen= (but that's eventually going to expire anyway unless you also take care of refreshing it), or build another Web App (or API endpoint in your current one) that you send a secret to, goes out to Azure AD and hands you the Bearer token.
OR if you're really in for a very entertaining afternoon, do the OAuth dance from your Edison!
A curl sample here:
https://ahmetalpbalkan.com/blog/azure-rest-api-with-oauth2/
For a tiny 2KB memory device (like Arduino Uno), storing both Bearer token and refresh token in memory is already game over.
I'd be very interested to learn if anyone has a better/more efficient/more secure approach to do authentication from microcontrollers with Mobile Apps.
Example - using X-SECRET as your custom authentication header:
// Todoitem.js
var azureMobileApps = require('azure-mobile-apps');
// Create a new table definition
var table = azureMobileApps.table();
// Execute only if x-secret header matches our secret
table.read(function (context) {
// All header names are in lowercase in context.req.headers
console.info('Got x-secret header with value: ' +
context.req.headers['x-secret']);
if (context.req.headers['x-secret'] == process.env.SECRET) {
console.info('Secret matches value in App Settings.');
return context.execute();
}
});
// Removed CREATE, UPDATE, DELETE definitions for brevity.
// YOU NEED TO PROTECT THOSE METHODS AS WELL!
// Finally, export the table to the Azure Mobile Apps SDK - it can be
// read using the azureMobileApps.tables.import(path) method
module.exports = table;
Behavior as seen from curl (needless to say you should use HTTPS if your Edison can do that):
$ curl -s -i http://{mobileapp}.azurewebsites.net/tables/todoitem \
-H "ZUMO-API-VERSION: 2.0.0"
HTTP/1.1 404 Not Found
...
X-Powered-By: Express
{"error":"The item does not exist"}
$ curl -s -i http://{mobileapp}.azurewebsites.net/tables/todoitem \
-H "ZUMO-API-VERSION: 2.0.0" \
-H "X-SECRET: SeCr3T="
HTTP/1.1 200 OK
...
X-Powered-By: Express
[
{
"id": "40b996d6-ec7f-4188-a310-0f02808e7093",
"createdAt": "2016-08-31T11:30:11.955Z",
...
"Yo_node":"Sup"
}
]
Using App Service Editor (Monaco / Visual Studio Online Editor) to code and check output - https://{mobileapp}.scm.azurewebsites.net/dev

Mule Facebook Samples Invalid redirect error

I have seen a lot of these errors all over the net with different developer framework
{
"error": {
"message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
"type": "OAuthException",
"code": 191
}
}
I am using Mule ESB to post a comment on a wall but get this error. I have used localhost and the IP address of my PC but nothing seems to work. I am behind a proxy server so not sure if that is the problem. It also seems that Facebook has chaned the UI of the apps page as a lot of sample refer to pages that do not exist anymore.
How do I get my Facebook page to accept my auth and then post using Mule.
Regards.
Jaco.
Have you configured Facebook properly? They tend to change their app system every few months, so any example is usually outdated. The following works with my test app (just tests auth, does not save token):
FB App:
Settings
-> Basic
-> Add Platform
-> App on Facebook
-> Canvas URL: http://localhost:3000/
Mule:
<facebook:config-with-oauth name="Facebook" appId="${id}" appSecret="${secret}" doc:name="Facebook">
<facebook:oauth-callback-config domain="localhost" localPort="3000" remotePort="3000"></facebook:oauth-callback-config>
</facebook:config-with-oauth>
<flow name="authorize">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="3000" path="authorize"></http:inbound-endpoint>
<facebook:authorize config-ref="Facebook"></facebook:authorize>
</flow>
If you have a proxy / port forwarding in your environment, you should add the remotePort option explicitly. I run my Mule inside a virtual machine, and it produces the invalid url error without it.