HandleOIDCCallback

Complete login process with the information provided by the OIDC identity provider in previous step.

rpc HandleOIDCCallback

user_api.v1.HandleOIDCCallback

Complete login process with the information provided by the OIDC identity provider in previous step.

requests HandleOIDCCallbackRequest

user_api.v1.HandleOIDCCallbackRequest

FieldTypeDescription
codestringCode received in the previous response.
statestringUsed to store OAuth 2.0 State.
resp, _ := userApiService.HandleOIDCCallback(ctx, &v1.HandleOIDCCallbackRequest{
  Code: "CODE_PREVIOUS_RESPONSE",
  State: "STATE_TOKEN_XYZABC123",
})
fmt.Println(resp)
const handleoidccallbackrequest = new HandleOIDCCallbackRequest();
handleoidccallbackrequest.setCode("CODE_PREVIOUS_RESPONSE");
handleoidccallbackrequest.setState("STATE_TOKEN_XYZABC123");

service.handleOIDCCallback(handleoidccallbackrequest, (err, value:HandleOIDCCallbackResponse|null) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
using System;
using Grpc.Core;
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 handleOIDCCallbackRequest = new HandleOIDCCallbackRequest{
        Code = "CODE_PREVIOUS_RESPONSE",
        State = "STATE_TOKEN_XYZABC123",
      };
      var reply = client.HandleOIDCCallback(handleOIDCCallbackRequest, 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.HandleOIDCCallbackRequest;
import user_api.v1.User.HandleOIDCCallbackResponse;
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);
    
    HandleOIDCCallbackRequest req_HandleOIDCCallbackRequest =
        HandleOIDCCallbackRequest.newBuilder()
          .setCode("CODE_PREVIOUS_RESPONSE")
          .setState("STATE_TOKEN_XYZABC123")
          .build();
    HandleOIDCCallbackResponse resp = blockStub.handleOIDCCallback(req_HandleOIDCCallbackRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const handleoidccallbackrequest = new HandleOIDCCallbackRequest();
handleoidccallbackrequest.setCode("CODE_PREVIOUS_RESPONSE");
handleoidccallbackrequest.setState("STATE_TOKEN_XYZABC123");

service.handleOIDCCallback(handleoidccallbackrequest, (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::HandleOIDCCallbackRequest;

#[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(
    HandleOIDCCallbackRequest{
      code: String::from("CODE_PREVIOUS_RESPONSE"),
      state: String::from("STATE_TOKEN_XYZABC123")
    });
// sending request and waiting for response
  let response = client.handle_oidc_callback(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import user_api.v1.User.HandleOIDCCallbackRequest
import user_api.v1.User.HandleOIDCCallbackResponse
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_HandleOIDCCallbackRequest = HandleOIDCCallbackRequest.newBuilder()
          .setCode("CODE_PREVIOUS_RESPONSE")
          .setState("STATE_TOKEN_XYZABC123")
          .build()
    val resp = blockStub.handleOIDCCallback(req_HandleOIDCCallbackRequest)
    println(resp)
    channel.shutdown()
}


returns HandleOIDCCallbackResponse

user_api.v1.HandleOIDCCallbackResponse

FieldTypeDescription
userUserUser object of the subject.
auth_tokenAuthTokenOAuth2 RFC6749 Access Token.
instance_namestringUsed by client to identify application instance initiating authentication.
request_originstringUsed by client to identify origin of the request initiating authentication.
client_stateStructUsed by client to store state.
{
  "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"
  },
  "instance_name": "INSTANCE_NAME",
  "request_origin": "REQUEST_ORIGIN",
  "client_state": {}
}