Uport integration for mobile/native apps does not have clear documentation--most documentation accounts for a front-end tech stack using Web3. Existing documentation is sparse at best, and does not include beginner-friendly language (i.e. what is a topic, and how does a topicFactory define topics or influence the request/response? Does attestation simply mean validating credentials? etc.)
Details
After carefully reading the Uport developer guide multiple times, referencing the API, and playing with Webpackbins, the farthest I could get was asking the user to login via the uriHandler.
Because there is no reference to mobile app development in the documentation, I had to complete a Google search to see what I could do for a react-native app. The only reference I found was this Github issue: https://github.com/uport-project/uport-connect/issues/39
This helped me get Uport interactions running on the app to allow me to login, but did not provide additional info on attesting credentials or signing transactions. In addition, it makes use of the topicFactory parameter from the API, but does not explain the logic of the code nor offers to define what a topic is and what a topicFactory does. In addition, this issue introduces using native iOS linking to link between the DApp and Uport--referencing a react-native document for linking that also fails to directly explain how to setup the app schema for the url.
Furthermore, after implementing this code, the topicFactory doesn't seem to actually be called, and the mobileUrlHandler is also functionless. Removing the topicFactory and mobileUrlHandler from the uriHandler function still allows the DApp to pass the request to Uport for logging in.
Overall, Uport assumes too much proprietary knowledge of the user and fails to describe the setup process from a beginner's perspective.
5. Attach to button to login:
```<ConcensusButton label="Login" onPress={authenticateWithUport} />```
Additional Comments
Another issue faced was setting up the DApp in the Uport portal. It appeared that after several attempts, the app would not save and form a transaction with the Uport ID app. This eventually resolved itself, although problems with registering continued to arise intermittently.
Summary
Uport integration for mobile/native apps does not have clear documentation--most documentation accounts for a front-end tech stack using Web3. Existing documentation is sparse at best, and does not include beginner-friendly language (i.e. what is a topic, and how does a topicFactory define topics or influence the request/response? Does attestation simply mean validating credentials? etc.)
Details
After carefully reading the Uport developer guide multiple times, referencing the API, and playing with Webpackbins, the farthest I could get was asking the user to login via the uriHandler.
Because there is no reference to mobile app development in the documentation, I had to complete a Google search to see what I could do for a react-native app. The only reference I found was this Github issue: https://github.com/uport-project/uport-connect/issues/39
The suggested solution was this Gist: https://gist.github.com/pelle/68287cb55253272a10d9ee9a6f7aeaf1
This helped me get Uport interactions running on the app to allow me to login, but did not provide additional info on attesting credentials or signing transactions. In addition, it makes use of the topicFactory parameter from the API, but does not explain the logic of the code nor offers to define what a topic is and what a topicFactory does. In addition, this issue introduces using native iOS linking to link between the DApp and Uport--referencing a react-native document for linking that also fails to directly explain how to setup the app schema for the url.
Furthermore, after implementing this code, the topicFactory doesn't seem to actually be called, and the mobileUrlHandler is also functionless. Removing the topicFactory and mobileUrlHandler from the uriHandler function still allows the DApp to pass the request to Uport for logging in.
Overall, Uport assumes too much proprietary knowledge of the user and fails to describe the setup process from a beginner's perspective.
Steps to Setup Uport App
Steps to Reproduce Uport Integration Attempt
node_modules/.bin/derequire node_modules/uport-connect/dist/uport-connect.js > src/vendor/uport-connect.js
const Connect = UportConnect.ConnectCore; const SimpleSigner = UportConnect.SimpleSigner;
const rpcUrl = 'https://rinkeby.infura.io/TN4nYidPt24zcMvOVYIE';
import URL from 'url-parse'; import qs from 'qs';
const uriHandler = (url) => { console.log(url); Linking.openURL(url); };
export const uport = new Connect('Concensus', { clientId: '2oek8Yv9tnhCqWXb3sS2v7orpWsje1MZPAm', network: 'rinkeby', signer: SimpleSigner('0a1f0c6a1ad43ccac720948a3f29556cc453df72ed969ee93eca85b80f7908aa'), uriHandler: uriHandler, rpcUrl });
function authenticateWithUport() { uport.requestCredentials({ requested: ['name', 'avatar', 'phone', 'country'], notifications: true }).then(profile => { /
/ console.log(profile);
uport.attestCredentials({ sub: profile.address, claim: { Authenticated: true }, exp: new Date().getTime() + 30 24 60 60 * 1000, // Optional expiration }); }); };
Additional Comments
Another issue faced was setting up the DApp in the Uport portal. It appeared that after several attempts, the app would not save and form a transaction with the Uport ID app. This eventually resolved itself, although problems with registering continued to arise intermittently.