AuthnWithProvider

Start login process against a selected identity provider. Supports OIDC and SAML.

rpc AuthnWithProvider

user_api.v1.AuthnWithProvider

Start login process against a selected identity provider. Supports OIDC and SAML.

requests AuthnWithProviderRequest

user_api.v1.AuthnWithProviderRequest

FieldTypeDescription
providerProvider enum
FieldNumberDescription
PROVIDER_UNSPECIFIED0Identity Provider to authenticate against via OIDC or SAML.Provider Unspecified.
PROVIDER_GITHUB1Identity Provider to authenticate against via OIDC or SAML.Provider GitHub.
PROVIDER_FACEBOOK2Identity Provider to authenticate against via OIDC or SAML.Provider Facebook.
PROVIDER_GOOGLE3Identity Provider to authenticate against via OIDC or SAML.Provider Google.
PROVIDER_SAML4Identity Provider to authenticate against via OIDC or SAML.Provider SAML.
PROVIDER_COGNITO5Identity Provider to authenticate against via OIDC or SAML.Provider Cognito.
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.
resp, _ := userApiService.AuthnWithProvider(ctx, &v1.AuthnWithProviderRequest{
  ClientState: &structpb.Struct{},
  InstanceName: "INSTANCE_NAME",
  Provider: v1.Provider_PROVIDER_UNSPECIFIED,
  RequestOrigin: "REQUEST_ORIGIN",
})
fmt.Println(resp)
const struct = new Struct();
const authnwithproviderrequest = new AuthnWithProviderRequest();
authnwithproviderrequest.setClientState(struct);
authnwithproviderrequest.setInstanceName("INSTANCE_NAME");
authnwithproviderrequest.setProvider(Provider.PROVIDER_GOOGLE);
authnwithproviderrequest.setRequestOrigin("REQUEST_ORIGIN");

service.authnWithProvider(authnwithproviderrequest, (err, value:AuthnWithProviderResponse|null) => {
    const resp = JSON.stringify(err ? err : value);
    console.log("received ", resp);
})
using System;
using Grpc.Core;
using Google.Protobuf.WellKnownTypes;
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 struct = new Struct{};
      var authnWithProviderRequest = new AuthnWithProviderRequest{
        ClientState = struct,
        InstanceName = "INSTANCE_NAME",
        Provider = Provider.Provider_unspecified,
        RequestOrigin = "REQUEST_ORIGIN",
      };
      var reply = client.AuthnWithProvider(authnWithProviderRequest, headers);
      Console.WriteLine("Response: " + reply);
      channel.ShutdownAsync().Wait();
    }
  }
}
package demo;

import io.grpc.Channel;
import io.grpc.ManagedChannel;
import io.grpc.ManagedChannelBuilder;
import com.google.protobuf.Struct;
import user_api.v1.User.AuthnWithProviderRequest;
import user_api.v1.User.AuthnWithProviderResponse;
import user_api.v1.User.Provider;
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);
    
    Struct req_Struct =
        Struct.newBuilder()
          .build();
    AuthnWithProviderRequest req_AuthnWithProviderRequest =
        AuthnWithProviderRequest.newBuilder()
          .setClientState(req_Struct)
          .setInstanceName("INSTANCE_NAME")
          .setProvider(Provider.PROVIDER_UNSPECIFIED)
          .setRequestOrigin("REQUEST_ORIGIN")
          .build();
    AuthnWithProviderResponse resp = blockStub.authnWithProvider(req_AuthnWithProviderRequest);
    System.out.println(resp);
    channel.shutdown();
  }
}
const struct = new Struct();
const authnwithproviderrequest = new AuthnWithProviderRequest();
authnwithproviderrequest.setClientState(struct);
authnwithproviderrequest.setInstanceName("INSTANCE_NAME");
authnwithproviderrequest.setProvider(Provider.PROVIDER_SAML);
authnwithproviderrequest.setRequestOrigin("REQUEST_ORIGIN");

service.authnWithProvider(authnwithproviderrequest, (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 prost_types::Struct;
use grpc-sdks::user_api::v1::Provider;
use grpc-sdks::user_api::v1::AuthnWithProviderRequest;

#[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(
    AuthnWithProviderRequest{
      client_state: Some(Struct{
        fields: Vec::from([])
      }),
      instance_name: String::from("INSTANCE_NAME"),
      provider: Provider::ProviderUnspecified as i32,
      request_origin: String::from("REQUEST_ORIGIN")
    });
// sending request and waiting for response
  let response = client.authn_with_provider(request).await?.into_inner();
  println!("RESPONSE={:?}", response);
  Ok(())
}
package app

import io.grpc.ManagedChannelBuilder
import com.google.protobuf.Struct
import user_api.v1.User.AuthnWithProviderRequest
import user_api.v1.User.AuthnWithProviderResponse
import user_api.v1.User.Provider
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_Struct = Struct.newBuilder()
          .build()
    val req_AuthnWithProviderRequest = AuthnWithProviderRequest.newBuilder()
          .setClientState(req_Struct)
          .setInstanceName("INSTANCE_NAME")
          .setProvider(Provider.PROVIDER_UNSPECIFIED)
          .setRequestOrigin("REQUEST_ORIGIN")
          .build()
    val resp = blockStub.authnWithProvider(req_AuthnWithProviderRequest)
    println(resp)
    channel.shutdown()
}


returns AuthnWithProviderResponse

user_api.v1.AuthnWithProviderResponse

FieldTypeDescription
provider_urlstringCallback URL to be used for authentication.
{
  "provider_url": "PROVIDER_URL"
}