Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@qubic-connect/redirect

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qubic-connect/redirect

```txt # https://sequencediagram.org/ title Qubic Connect Auth Flow bottomparticipants participant "Client" as client participant "Client Service" as clientService participant "Qubic Connect SDK" as sdk participant "Auth Web" as auth participant "Qubic Wa

  • 0.9.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
decreased by-80.39%
Maintainers
2
Weekly downloads
 
Created
Source

qubic connect auth flow

# https://sequencediagram.org/
title Qubic Connect Auth Flow
bottomparticipants
participant "Client" as client
participant "Client Service" as clientService
participant "Qubic Connect SDK" as sdk
participant "Auth Web" as auth
participant "Qubic Wallet" as wallet
participant "Qubic Auth Admin Api" as adminApi

entryspacing 1.0

## loginWithRedirect
note over client, wallet: loginWithRedirect

client->sdk:loginWithRedirect\n
	sdk->auth:navigate to auth web\n{\n  action: 'login' \n  walletType\n  qubicSignInProvider\n  redirectUrl\n  dataString\n\n}

	alt Qubic Wallet and has redirectUrl
		auth->wallet:navigate to wallet\n{\n  ticketRedirectUrl,\n  provider: 'facebook' | 'google' | 'apple' | 'yahoo'\n}
wallet->wallet:sign in success and get ticket from wallet service
		sdk<--wallet:response\n{\n  action: 'login'\n  accountAddress\n  signature: ticket\n  dataString\n  isQubicUser: true\n}\n// when isQubicUser true signature would be a ticket from wallet service\n
	else WalletConnect/Metamask
		auth->auth:active wallet and sign
		sdk<--auth:response\n{\n  action: 'login'\n  accountAddress\n  signature\n  dataString\n  isQubicUser: false\n\n}

end

sdk->sdk:handleRedirectUrl\n
sdk->adminApi:以 qubic wallet 登入\n/services/auth/qubic\npayload {address,ticket} \n\n其他錢包登入\n/services/auth\npayload {provider, signature, address data}
sdk<--adminApi:response {accessToken, expiredAt, isQubicUser}
sdk->sdk
client<--sdk:trigger onAuthChanged\n{\n  method\n  address\n  accessToken\n  expiredAt\n  provider\n  qubicUser\n}

## bindWithRedirect

note over client, adminApi: bindWithRedirect


client->sdk:bindWithRedirect\n
sdk->adminApi:clientTicketIssue\n
sdk<-adminApi:response { ticket, expiredAt }
	sdk->auth:navigate to auth web\n{\n  action: 'bind'\n  clientTicket\n  walletType\n  qubicSignInProvider\n  redirectUrl\n  dataString\n}\n\n


else action:bind
	alt Qubic Wallet
    auth->wallet:navigate to wallet\n{\n  ticketRedirectUrl,\n  provider: 'facebook' | 'google' | 'apple' | 'yahoo'\n}
    wallet->wallet:sign in success and get ticket from wallet service
	auth<--wallet:response\n{\n  ticket\n  expiredAt\n  address\n}
    else WalletConnect/Metamask
		auth->auth:active wallet and sign
	end
auth->adminApi:以 qubic wallet 登入\n/services/auth/qubic\npayload {address,ticket} \n\n其他錢包登入\n/services/auth\npayload {provider, signature, address data} \n\n帶入 clientTicket \nheaders { X-Qubic-Client-Ticket }
auth<--adminApi:response {accessToken, expiredAt, isQubicUser, clientId, merchantName, clientIconUrl}
	auth->auth:show confirm auhtorized to user\n
auth->adminApi:gql PrimeBind \nheaders { X-Qubic-Client-Ticket }
auth<--adminApi:response { bindTicket, expireTime }
	sdk<--auth:response \n{\n  action: 'bind',\n  bindTicket: string,\n  expiredAt: number\n}


sdk->sdk:handleRedirectUrl\n

client<--sdk:trigger onBindTicketResult\n{\n  bindTicket,\n  expiredAt,\n}
client->clientService:sendBindToken to client service
client<--clientService:bind success with credential\n{\n  identityTicket,\n  expiredAt,\n  address\n}

note over client,adminApi:After binding success, you can login with client service

client->clientService:login
client<--clientService:response with credential\n{\n  identityTicket,\n  expiredAt,\n  address\n}
client->sdk:loginWithCredential
sdk->adminApi:/services/auth/prime\npayload {identityTicket, address}\n
sdk<--adminApi:response {accessToken, expiredAt, isQubicUser}
client<--sdk:trigger onAuthChanged\n{\n  method\n  address\n  accessToken\n  expiredAt\n  provider\n  qubicUser\n}

FAQs

Package last updated on 19 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc