Skip to content

nangs/sn_authenticator_mobile

 
 

Repository files navigation

Safe Authenticator Mobile

The Safe Authenticator acts as a gateway to the Safe Network by enabling users to create an account & authenticate themselves onto the Safe Network. It helps users ensure they have full control over the permissions they grant to Safe apps.

Maintainer: Ravinder Jangra (ravinder.jangra@maidsafe.net)

Build Status

CI service Platform Status
Azure DevOps MacOS Build Status

Table of Contents

Overview

Safe Authenticator mobile is a cross platform mobile (Android, iOS) application that can be used to create an account and login into the Safe Network. The app also helps the user to authenticate other Safe apps and manage access permissions for the already registered applications.

The app is developed using Xamarin.Forms. Xamarin.Forms is a cross-platform UI toolkit that allows developers to efficiently create native user interface layouts that can be shared across iOS, Android.

The app contains .NET wrapper for safe_authenticator, C# bindings and safe_authenticator native libraries. safe_authenticator provides authenticator functions, which include users account registration, login, apps authentication, apps revocation, and communication with apps through the IPC mechanism.

Features

  • Create your account & login to the Safe network:

    • Start by providing a secret & password that serves as your digital fingerprint on the Safe Network to create an account.
    • Login to the Safe Network
    • Auto-reconnect: Turn on auto-reconnect to automatically log into the app when resuming from background mode.
  • Handle Access Requests from Apps: The Safe application authorises through the Authenticator with the required access permissions. The application can create its own container and request access to default containers of the Safe Network i.e. documents, downloads, music, pictures, videos, public and public names, or other application's containers through the authorisation request.

    • Auth Request: Allow apps to request default container access & also to create an app's own private container.
    • Container Request: Application request access for user's default containers only.
    • Shared Mutable Data Request: Request access to mutable data owned by the user.
    • Unregistered Access: Allow an app to read public unencrypted content.
  • User Grants Access: When the user approves the request, application specific encryption keys are generated. The application will be identified in the network using its keys. When the user grants or denies authorisation, the application will receive a URI. The user has the option to grant permission to an application to access user data.

  • User can revoke app access: User has the option to revoke access for an app that they have granted access to previously.

  • Select network: User can connect to the different networks using different network connection files from the settings page.

User Guide

Installation

The latest version of the Authenticator app can be downloaded using following links and QR code for Android and iOS devices.

Platform OS & Architecture Download Link QR Code
Android 5.0+ (armeabi-v7a, x86_64) AppCenter, GitHub Android-QR
iOS iOS 11+ (ARM64, x64) AppCenter iOS-QR

Note: We use Azure App Center to distribute iOS builds. Please register here so we can add you in our testing group so you can download and install the app.

Screenshots

Tutorial Login Create Account

Home Request Details Settings

Development

Project structure

  • SafeAuthenticator:
    • C# API wrapper for the safe_authenticator bindings
    • C# safe_authenticator bindings generated from sn_client
    • Binding utilities and helper functions
    • Common UI code and Safe logic for mobile app
  • SafeAuthenticator.Platform:
    • Platform: Android, iOS
    • Contains native libraries for the platform
    • C# safe_authenticator platform bindings
    • Platform specific/dependent code
      • Custom controls for native UI
      • Platform assets
      • Platform dependent service code
  • Tests:
    • Contains shared unit test project for Safe Authenticator API.
    • Platform specific projects containing setup required to run shared tests on Android and iOS.

Interfacing with Safe Network Client

The package uses native code written in Rust and compiled into the platform specific code. Learn more about the sn_client in the Safe Network client libraries wiki.

Instructions to update the safe_authnenticator bindings in the Safe Authenticator App:

  • Generate bindings for safe_authenticator.
  • Update AuthTypes, BindingUtils and IAuthBindings file in SafeAuthenticator project.
  • Update binding classes AuthBindings.cs andAuthBindings.Manual.cs in platform specific code with newly generated bindings.

Note: Please make sure the changes made in the manual files in Safe Authenticator are synced with sn_client and vice versa.

Interoperability between C# managed and unmanaged code

Platform invoke is a service that enables managed code to call unmanaged functions that are implemented in dynamic link libraries or native libraries. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed. Check links in useful resources section to know more about how P/Invoke works in different .NET environments and platforms.

Tests

We use shared unit tests for safe_authenticator API which can be run on Android and iOS platforms.

Tools required

Useful resources

Further help

Get your developer related questions clarified on Safe Dev Forum. If you're looking to share any ideas or thoughts on the Safe Network you can reach out on Safe Network Forum

License

This Safe Network library is dual-licensed under the Modified BSD (LICENSE-BSD https://opensource.org/licenses/BSD-3-Clause) or the MIT license (LICENSE-MIT https://opensource.org/licenses/MIT) at your option.

Contributing

Want to contribute? Great 🎉

There are many ways to give back to the project, whether it be writing new code, fixing bugs, or just reporting errors. All forms of contributions are encouraged!

For instructions on how to contribute, see our Guide to contributing.

About

SAFE Authenticator mobile application (Android,IOS)

Resources

License

BSD-3-Clause, MIT licenses found

Licenses found

BSD-3-Clause
LICENSE-BSD
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.4%
  • Shell 0.6%