Giter Club home page Giter Club logo

a2p3_agent's Introduction

A2P3_agent

This is a PersonalAgent for a2p3.net demonstration environment. It is compliant with the specification of the A2P3 protocol version 9.

The Agent targets iOS 4.3-6 for the iPhone and iPad. The beginnings of an Android port are in progress.

The Agent has been tested on the iPhone 4-5 iOS 5-6 and iPad iOS 5-6.

For Developers:

This application makes use of the following libs/frameworks, most notably:

  • phoneGap/cordova
  • backbone
  • underscore
  • jquery mobile
  • jstorage
  • various phonegap plugins

The iOS version is located in the AppiOS folder and the Android verion is located in the AppAndroid folder. The www folder was copied from the AppiOS and put into the Android folder at version 1.7 for port PoC purposes only. An upcoming archiectural challenge will be to figure out how to keep the two www folders logically in-sync while accomodating platform specific modifications.

To run Agent locally in a web browser:

  • Disable the cross domain policy in your browser, e.g.,

      Chrome:
      	chrome.exe --disable-web-security
    
  • Run through web server to stop the local file cross domain policy protection.

Some device specific functions will not work including:

  • QR Code Scanning

  • Custom schema (a2p3.net://token?request=...) handling from the OS.

      You can invoke the javascript function directly in a browser console by calling handleOpenURL(url); 
    
  • Push Notifications (TBD on how to do this manually)

There is a .project file for the Aptana software.

To run Agent on iPhone with using local IP addresses or if you need to sniff traffic:

  • Create an ad-hoc wireless network on computer
  • Configure iPhone to to use that wireless network
  • Install a HTTP proxy on computer such as Fiddler2
  • Edit wireless settings on iPhone to use that proxy

For Designers:

The Agent makes use of jquery mobile controls. Any application specific styles should use the app.css to override or append styles.

Design guidelines:

  • Clean, simple and minimal
  • Agent must be distinguishable from other A2P3 apps

Tips and Tricks:

The global function handleOpenUrl(url) can be used to trigger the enrollment direct and login direct.

For debugging on mobile, jsconsole can be very handy especially where you have to run a deployment signed application such as testing Apple push notifications (which can't be debugged in XCode).

Related

A2P3 project home page

A2P3_specs Specifications and POC documentation

A2P3 POC Server implementation source (node.js)

A2P3_bank POC mobile bank app (PhoneGap)

node-a2p3 node.js npm module for A2P3 applications

sample-node-a2p3 sample A2P3 application using node-a2p3

rs-sample-node-a2p3 sample A2P3 resource server using node-a2p3

License

MIT License

Copyright (c) 2013 Province of British Columbia

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.

IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

a2p3_agent's People

Contributors

dickhardt avatar gregturner avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

devfacto

a2p3_agent's Issues

Authorization prompt

"Clinic is requesting:"

"Clinic requests:"

The font should probably be a little smaller for this title so that apps with longer names will work easily.

Also, would be nice if the buttons were larger and said

[Cancel] [Authorize]

Signal direct agent enrollment

Add query parameter when launching enrollment from Agent so that we can be smarter on which pages to show the user. Can move directly from User enrollment to prompting for passcode.

add "?agent=true" to http://setup.*./

Agent is appending junk to end of calls

After a QR scan, the Agent appends a weird "_" var to all URLs as an extra query parameter. It looks like the current time in ms.

2013-02-01T08:48:05|10.0.0.31 bank.dev.a2p3.net GET /QRnew/0OF_tcEEbQqTtCgIMHt8OA?json=true&=1359737287422 200 3 ms - -
requestVerify Agent Request eyJ0eXAiOiJKV1MiLCJhbGciOiJIUzUxMiIsImtpZCI6Im5uWUdESnZLXzZWZUFBQ0wifQ.eyJpc3MiOiJiYW5rLmRldi5hMnAzLm5ldCIsImF1ZCI6Iml4LmRldi5hMnAzLm5ldCIsImlhdCI6MTM1OTczNzI4NiwicmVxdWVzdC5hMnAzLm9yZyI6eyJyZXNvdXJjZXMiOlsiaHR0cDovL3Blb3BsZS5kZXYuYTJwMy5uZXQvc2NvcGUvZGV0YWlscyIsImh0dHA6Ly9zaS5kZXYuYTJwMy5uZXQvc2NvcGUvYW55dGltZS9udW1iZXIiXSwiYXV0aCI6eyJwYXNzY29kZSI6dHJ1ZSwiYXV0aG9yaXphdGlvbiI6dHJ1ZX0sInJldHVyblVSTCI6Imh0dHA6Ly9iYW5rLmRldi5hMnAzLm5ldC9yZXNwb25zZSJ9fQ.5N8DVjIlaMrKkx2oXepThNrWqtHwpQlqVF_6DSdeYvumPAGE4_GQSRQ3hFEwWEERNJzDduny47d9IdALGIUVuA
2013-02-01T08:48:06|10.0.0.31 registrar.dev.a2p3.net POST /request/verify 200 2 ms - -
2013-02-01T08:48:06|10.0.0.31 si.dev.a2p3.net GET /scope/anytime/number?
=1359737287549 200 1 ms - -
2013-02-01T08:48:06|10.0.0.31 people.dev.a2p3.net GET /scope/details?_=1359737287538 200 1 ms - -

logon to email.a2p3.net from iPhone reports Logon Error

Peter reported and I confirmed.

This error appears to affect all logons when using the Agent.

The response to the app looks OK. But the app complains of Lost Session information.

GET /login/response?token=eyJ0eXAiOiJKV0UiLCJhbGciOiJkaXIiLCJlbmMiOiJBMjU2Q0JDK0hTNTEyIiwia2lkIjoiNWFwVGc0bk9KS2VkMkw2RyJ9..647lZT8BIO2m-8sniFJ-6A.91-aS3JcHs8h2GqJdTgRATF500rOE1iLfFts3nL-DYefGGLs_4cVzWY6aoUDFHODCOlVtXM7XfNbO0unz1FErGKAOwEc_UIAoAz95kKmzMc3JhaVZNVlCE5_r_VC1qOuEfed3UpCdAxt1JSPy8g0p-cR6xpgAidAjtXe9e6xpKNOWWJzOMedA0rD-fyUb632skPEVLEjxoP5TnyvnbEmbaMweB46ZH_FKiAo9phLGKQYLibMYu8QN7BiYVqtbgdHBDkxlmuFgF3w3FVVv5FzIyBiOJq1bDqRiB0uuU71R-Omyw08cCZgP3LtYwweTGnvVIZ-uXEgfcKqfZsyE08qvrz-doEKCcYxCAI22KanZo.tKZiD6yhT74idh7xE2sS4FAFwjJFN73JU8n-oYiTdK43GrIomabDcqpCmq4HRcMyW-u1opm2doJGg4oRGTGyQ&request=eyJ0eXAiOiJKV1MiLCJhbGciOiJIUzUxMiIsImtpZCI6Imw0aUpMdUlRc3A4RU9ldFgifQ.eyJpc3MiOiJlbWFpbC5hMnAzLm5ldCIsImF1ZCI6Iml4LmEycDMubmV0IiwicmVxdWVzdC5hMnAzLm9yZyI6eyJyZXR1cm5VUkwiOiJodHRwOi8vZW1haWwuYTJwMy5uZXQvbG9naW4vcmVzcG9uc2UiLCJyZXNvdXJjZXMiOlsiaHR0cDovL2VtYWlsLmEycDMubmV0L3Njb3BlL2RlZmF1bHQiLCJodHRwOi8vcmVnaXN0cmFyLmEycDMubmV0L3Njb3BlL3ZlcmlmeSJdLCJhdXRoIjp7InBhc3Njb2RlIjp0cnVlLCJhdXRob3JpemF0aW9uIjp0cnVlfX0sImlhdCI6MTM1OTQxMzI2Mn0.NNf_d-mWXXayHuJIfs0IBC9CRj0_fZpEf3iXNDq36WXFgbpep94lSXBk9RJOx6xCjL0O6-qP4TdBoKgTGJuWqw HTTP/1.1
Host: email.a2p3.net
Connection: keep-alive
Accept-Encoding: gzip, deflate
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Language: en-us
Connection: keep-alive
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_2 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A551 Safari/8536.25

HTTP/1.1 302 Moved Temporarily
x-powered-by: Express
location: http://email.a2p3.net/error?error=UNKNOWN&errorMessage=Session%20information%20lost
vary: Accept
content-type: text/html
content-length: 230
set-cookie: connect.sess=s%3Aj%3A%7B%7D.Rk7TmQemKFe4jmSk2ofPNcLPGdWGd4B2UV30vnHfWao; Path=/; HttpOnly
date: Mon, 28 Jan 2013 22:47:50 GMT
connection: keep-alive, keep-alive

Moved Temporarily. Redirecting to http://email.a2p3.net/error?error=UNKNOWN&errorMessage=Session%20information%20lost

add notification

support the "remember me" function by listening for push notification from mobile locator service.

add letters to pin pad

dick: Useful to show the keypad letters on T9 key pad as some people use a mnemonic to remember their pin.

Passcode entry usability

Solve the focus to next input field problem with popup keyboard OR use a single input element.

Resource request persisting across requests

I openned an account using agent on a2p3.net

I reset agent and set values to dev.a2p3.net

When logging into account, I am asked to release data for:

si.a2p3.net
si.dev.a2p3.net
people.a2p3.net
people.dev.a2p3.net

Looks like there is state being maintained between requests that should not be maintained.

Agent is not sending state back

open bank app
Open an Account -> QR code comes up
Scan QR code
bank sends result below
Agent does NOT send state parameter back in get to returnURL, only sends token and request

{ result:
{ agentRequest: 'eyJ0eXAiOiJKV1MiLCJhbGciOiJIUzUxMiIsImtpZCI6Im5uWUdESnZLXzZWZUFBQ0wifQ.eyJpc3MiOiJiYW5rLmRldi5hMnAzLm5ldCIsImF1ZCI6Iml4LmRldi5hMnAzLm5ldCIsImlhdCI6MTM1OTczODk5NiwicmVxdWVzdC5hMnAzLm9yZyI6eyJyZXNvdXJjZXMiOlsiaHR0cDovL3Blb3BsZS5kZXYuYTJwMy5uZXQvc2NvcGUvZGV0YWlscyIsImh0dHA6Ly9zaS5kZXYuYTJwMy5uZXQvc2NvcGUvYW55dGltZS9udW1iZXIiXSwiYXV0aCI6eyJwYXNzY29kZSI6dHJ1ZSwiYXV0aG9yaXphdGlvbiI6dHJ1ZX0sInJldHVyblVSTCI6Imh0dHA6Ly9iYW5rLmRldi5hMnAzLm5ldC9yZXNwb25zZSJ9fQ.4R9WlmtK9gARB4miX7mJ9XhfedaMd1TS8bS4b8lVaPQ66yiojyC6wstiYu-X9IS_W4aqTnQx1ejhlpDwiZDCMQ',
state: '3b1TuMvY4dVH8PzfPp6FLQ' } }

Agent prompts for release of no data

When scanning QR code on Bank after clicking Login
Agent prompts with sceeen

There should be no prompt when there are no resources being requested

IMG_0970

Agent does not fail transaction when it has an INVALID_TOKEN

If the Agent was registered against an earlier DB of the A2P3 servers, it will no longer have a valid token and potentially device.

When calling Registrar /request/verify the Agent will get the following error:

INVALID_TOKEN unrecognized agent token

The Agent should alert the User and abort the transaction.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.