diff options
author | qrort <qrort@yandex-team.com> | 2022-11-30 23:47:12 +0300 |
---|---|---|
committer | qrort <qrort@yandex-team.com> | 2022-11-30 23:47:12 +0300 |
commit | 22f8ae0e3f5d68b92aecccdf96c1d841a0334311 (patch) | |
tree | bffa27765faf54126ad44bcafa89fadecb7a73d7 /library/java/tvmauth/examples/create_with_tvmtool/Create.java | |
parent | 332b99e2173f0425444abb759eebcb2fafaa9209 (diff) | |
download | ydb-22f8ae0e3f5d68b92aecccdf96c1d841a0334311.tar.gz |
validate canons without yatest_common
Diffstat (limited to 'library/java/tvmauth/examples/create_with_tvmtool/Create.java')
-rw-r--r-- | library/java/tvmauth/examples/create_with_tvmtool/Create.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/library/java/tvmauth/examples/create_with_tvmtool/Create.java b/library/java/tvmauth/examples/create_with_tvmtool/Create.java new file mode 100644 index 0000000000..351327a057 --- /dev/null +++ b/library/java/tvmauth/examples/create_with_tvmtool/Create.java @@ -0,0 +1,30 @@ +package ru.yandex.example; + +import ru.yandex.passport.tvmauth.NativeTvmClient; +import ru.yandex.passport.tvmauth.TvmClient; +import ru.yandex.passport.tvmauth.TvmToolSettings; + +public class Create { + // Possibility of using functions depends on config of tvmtool + // checkServiceTicket + // checkUserTicket + // getServiceTicketFor + + public static TvmClient createClientInQloudOrYandexDeploy() { + TvmToolSettings settings = TvmToolSettings.create("my_service"); + + NativeTvmClient c = new NativeTvmClient(settings); + + return c; + } + + public static TvmClient createClientForDevOrTests() { + TvmToolSettings settings = TvmToolSettings.create("my_service"); + settings.setPort(18080); + settings.setAuthToken("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); + + NativeTvmClient c = new NativeTvmClient(settings); + + return c; + } +} |