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()
}