Finish login with cryptographic challenge and bearer token is returned to the caller.
rpc AuthnWallet
AuthnWallet
user_api.v1.AuthnWallet
user_api.v1.AuthnWallet
Finish login with cryptographic challenge and bearer token is returned to the caller.
requests AuthnWalletRequest
AuthnWalletRequest
user_api.v1.AuthnWalletRequest
user_api.v1.AuthnWalletRequest
Field | Type | Description |
---|---|---|
signature | bytes | Signed value of the challenge by the wallet. |
nonce | string | Value used for the challenge. |
did | string | W3C Decentralized Identifier (DID) of the wallet. |
resp, _ := userApiService.AuthnWallet(ctx, &v1.AuthnWalletRequest{
Did: "did:method-name:zDIDMultibase58Encoded",
Nonce: "NONCE",
Signature: []byte{7,43,94,45,233,224,182,20,162,130,118,173,186,183,149,106,184,158,176,28,128,150,10},
})
fmt.Println(resp)
const authnwalletrequest = new AuthnWalletRequest();
authnwalletrequest.setDid("did:method-name:zDIDMultibase58Encoded");
authnwalletrequest.setNonce("NONCE");
authnwalletrequest.setSignature(Uint8Array.from([7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10]));
service.authnWallet(authnwalletrequest, (err, value:AuthnWalletResponse|null) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
using System;
using Grpc.Core;
using Google.Protobuf;
using System.Text;
using UserApi.V1;
namespace main
{
class Program
{
static void Main(string[] args)
{
Channel channel = new Channel("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io:443", ChannelCredentials.Insecure);
var client = new UserApiService.UserApiServiceClient(channel);
var headers = new Metadata();
var authnWalletRequest = new AuthnWalletRequest{
Did = "did:method-name:zDIDMultibase58Encoded",
Nonce = "NONCE",
Signature = ByteString.CopyFrom(new byte[]{7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10}),
};
var reply = client.AuthnWallet(authnWalletRequest, headers);
Console.WriteLine("Response: " + reply);
channel.ShutdownAsync().Wait();
}
}
}
package demo;
import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import user_api.v1.User.AuthnWalletRequest;
import user_api.v1.User.AuthnWalletResponse;
import user_api.v1.UserApiServiceGrpc;
public class App {
public static void main(String[] args) {
ManagedChannel channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build();
UserApiServiceGrpc.UserApiServiceBlockingStub blockStub =
UserApiServiceGrpc.newBlockingStub(channel);
AuthnWalletRequest req_AuthnWalletRequest =
AuthnWalletRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setNonce("NONCE")
.setSignature(com.google.protobuf.ByteString.copyFrom(new byte[]{7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10}))
.build();
AuthnWalletResponse resp = blockStub.authnWallet(req_AuthnWalletRequest);
System.out.println(resp);
channel.shutdown();
}
}
const authnwalletrequest = new AuthnWalletRequest();
authnwalletrequest.setDid("did:method-name:zDIDMultibase58Encoded");
authnwalletrequest.setNonce("NONCE");
authnwalletrequest.setSignature(Uint8Array.from([7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10]));
service.authnWallet(authnwalletrequest, (err, value) => {
const resp = JSON.stringify(err ? err : value);
console.log("received ", resp);
})
extern crate grpc-sdks;
use tonic::transport::Channel;
use grpc-sdks::user_api::v1::user_api_service_client::UserApiServiceClient;
use grpc-sdks::user_api::v1::AuthnWalletRequest;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let channel = Channel::from_static("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io")
.connect()
.await?;
let mut client = UserApiServiceClient::new(channel);
let request = tonic::Request::new(
AuthnWalletRequest{
did: String::from("did:method-name:zDIDMultibase58Encoded"),
nonce: String::from("NONCE"),
signature: Vec::from([7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10])
});
// sending request and waiting for response
let response = client.authn_wallet(request).await?.into_inner();
println!("RESPONSE={:?}", response);
Ok(())
}
package app
import io.grpc.ManagedChannelBuilder
import user_api.v1.User.AuthnWalletRequest
import user_api.v1.User.AuthnWalletResponse
import user_api.v1.UserApiServiceGrpc
fun main() {
val channel = ManagedChannelBuilder
.forAddress("user-mgmt.YOUR_SANDBOX_ID.knoxnetworks.io", 443)
.usePlaintext()
.build()
var blockStub = UserApiServiceGrpc.newBlockingStub(channel)
val req_AuthnWalletRequest = AuthnWalletRequest.newBuilder()
.setDid("did:method-name:zDIDMultibase58Encoded")
.setNonce("NONCE")
.setSignature(com.google.protobuf.ByteString.copyFrom(byteArrayOf(7, 43, 94, 45, 233, 224, 182, 20, 162, 130, 118, 173, 186, 183, 149, 106, 184, 158, 176, 28, 128, 150, 10)))
.build()
val resp = blockStub.authnWallet(req_AuthnWalletRequest)
println(resp)
channel.shutdown()
}
returns AuthnWalletResponse
AuthnWalletResponse
user_api.v1.AuthnWalletResponse
user_api.v1.AuthnWalletResponse
{
"user": {
"uuid": "UUID",
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]",
"role": 0,
"avatar": "AVATAR_URL",
"phone": "+1 555 555 5555",
"dids": [
"did:method-name:zDIDMultibase58Encoded",
"did:method-name:zDIDMultibase58Encoded"
],
"external_ids": [
{
"key": "KEY1",
"value": "VALUE1"
},
{
"key": "KEY2",
"value": "VALUE2"
}
],
"metadata": {
"fields": []
},
"account": "15436675"
},
"auth_token": {
"token": "TOKEN",
"token_type": "TOKEN_TYPE",
"expires_in": 100,
"refresh_token": "REFRESH_TOKEN"
}
}