Aioha: All-In-One Hive Authentication

Introducing Aioha, an all-in-one Hive authentication API that provides a common interface across different Hive login providers.

Working with Hive authentication has never been easier than before. With Aioha, developers can integrate Hive logins and interact with the network on their applications without having to go through the implementation of each individual provider. This way they can focus on the main functionality of the application.

Aioha is designed for use in browser contexts.

Aioha Core

The main library that contains the inner workings of Aioha, is now ready to use on web apps. As of now, it currently supports 5 login providers:

In addition to providing the common programmatic interface, it also handles storing and loading persistence logins (aka "remember me") in-browser using local storage. Below is a very brief preview of Aioha in action:

import { initAioha, Asset, KeyTypes, Providers } from '@aioha/aioha'

// Instantiation. See usage docs for optional configs.
const aioha = initAioha()

// Get registered providers
console.log(aioha.getProviders())

// Get current logged in user and provider name
if (aioha.isLoggedIn()) {
  console.log(aioha.getCurrentUser(), aioha.getCurrentProvider())
}

// Login with provider
const login = await aioha.login(Providers.Keychain, 'hiveusername', {
  msg: 'Hello World',
  keyType: KeyTypes.Posting,
  hiveauth: {
    cbWait: (payload, evt) => {
      // display HiveAuth QR code using `payload` as data
    }
  }
})

// Transfer 1 HIVE using logged in provider
const xfer = await aioha.transfer('recipient', 1, Asset.HIVE, 'Transferred using Aioha with memo')

// Vote comment with 100% weight
const vote = await aioha.vote('author', 'permlink', 10000)

// Claim rewards
const rewardClaim = await aioha.claimRewards()

Refer to the usage docs for more details.

What's next?

The release of Aioha core is just the beginning. There are more to come in the next few weeks leading up to HiveFest 9 in order to make the developer and user experience even better.

We may conduct polls on the below matters on @aioha account to collect insights on how we can improve the implementation on Aioha.

Multi-Account Login

From the initial feedback received, it will be possible to be logged in to multiple accounts simultaneously and have the ability to switch between them with a single-line Aioha core method call.

Anonymous Login

There are certain applications (such as this one) that may not want to formally authenticate users, but be able to perform on-chain actions within a click of a button.

Anonymous logins on Aioha will work in a way where the user will not enter their username on the application, but instead select an account to sign the transaction on the provider itself (i.e. choosing the transaction sender on the Keychain popup). Note that this may not work with all available providers on Aioha.

Ready Made UI

Besides Aioha core, these are framework-specific libraries that implements all the UI logic required for an Aioha-powered Hive login modal.

It handles checks of whether the relevant extensions are installed in the browser, the login flow (i.e. getting username input, showing HiveAuth QR code etc), and finally display them in a ready-made modal. This should also make adding the HiveSigner callback page as simple as importing a component and using it as the page in a route (within one line of code of course).

One-Click Login

Other than improving developer (and hence user) experience of Hive logins, we will also be looking into the signup experience.

Recently, we have observed that signup providers that provide a one-click login experience have helped one of the top Hivemind communities to onboard many of their users. Although Aioha does not intent to be a signup provider itself, we plan to replicate the one-click login functionality through HiveSigner provider using framework-specific libraries aforementioned above.

Links

Landing page and docs: https://aioha.dev
Github: https://github.com/aioha-hive
NPM: https://www.npmjs.com/package/@aioha/aioha
Sting: https://chat.peakd.com/t/hive-134220/1

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now