Aioha: All-In-One Hive Authentication

in HiveDevs6 months ago

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

Sort:  

This is a great initiative! And absolutely needed for Hive!

it seems useful.
I will keep an eye on it.
Not sure if it fixes any issues I have seen but I support anything that will standardize things

It makes writing standard libraries for Hive possible. Currently if you want to write any library for Hive you have to write for 5+ different wallet providers. A few months ago when I was building the VSC client I held off on Hive login due to this limitation.

I understand this and this is a good thing.
I am holding off judgment until I see the exact code.
I have my fingers crossed this will be good, but I have seen other projects fail and I have not seen any announcement of who is behind the project.

As long as the DHF doesn't pay them 600 HBD a day like for Keychain. I mean, come on.

@techcoderx is behind this project with guidance/feedback from VSC.

I like techcoderx a lot.

Bravo to the max! This sounds absolutely incredible, and I very much look forward to exploring it further! Thank you so much for this brilliant contribution to the Hive Blockchain Ecosystem! 😁 🙏 💚 ✨ 🤙

Sorry, can't read all texts above. Ain't got time, I have to do my meditation so I don't cloud my mind and start doing nonsense quantum, ai, cryptography coding. I should have paid close attention to my programming subject.

This is mostly for developers, however it may lead to improved UX for the end users when they have more resources to focus on the main functionality of their Hive apps.

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

Thank you for your witness vote!
Have a !BEER on me!
To Opt-Out of my witness beer program just comment STOP below

The npm page links to https://aioha.dev/docs/ which is a page not found. https://aioha.dev/docs/intro seems to be the intended link? Not sure, but that one works!

That was an error in the docs. https://aioha.dev/docs is the intended link for the intro page. Good catch!

Glad to be of service ^>^

Exactly what we needed 💪

untitled.gif

What I'd like to see to take this a step further is build a standardized JSON format that can be used irrespective of the codebase. (Similar to how ETH does it). This way we could implement wallet providers in entirely different codebases that are still interoperable without complicated translations or "glue code" between the SDK and a domain specific implementation. A practical example of this is I have a desktop app that uses Hive Auth RPC (tm), and a website that wants to use the desktop app for authentication/signing. The SDK (within browser) already understands the format the desktop app uses and interoperability is trivial once communication is setup. This shouldn't be too complicated to do and would work well along side other projects needing to do a similar thing.

Congratulations @aioha! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

You received more than 10 upvotes.
Your next target is to reach 50 upvotes.

You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

Check out our last posts:

LEO Power Up Day - June 15, 2024

How many successful run tests for this application? Just give me Percentage.

Supercool project!
Well done and keep building 💪🏼