You are viewing limited content. For full access, please sign in.

Question

Question

Get Authentication Token / Ticket

asked on April 4, 2019

I am trying to create a login page for an external application that will allow the user to grab files from Laserfiche using C#.net and the RepositoryAccess SDK.

I want to pass credentials to Laserfiche, get a ticket back to use on subsequent calls. This is so I do not have to save the username and password and repeatedly pass them for all followup calls.

1st call
Session.Login(username, password, repository);
var ticket = ???
return ticket;

Subsequent calls
Session.Login(repository, ticket);

// Do things with the session.

 

How do I get the ticket?
Is this the best way to approach this, or is there an alternative?
I feel like saving the username/password and repeatedly logging with it would be a security issue.

0 0

Replies

replied on April 4, 2019

Why don't you just reuse the existing session object? Logging in adds a lot of overhead, so in our SDK applications we establish the session, then pass the active session object around for reuse instead of logging in/out over and over.

0 0
replied on April 4, 2019

I honestly never thought of that, I missed part of the story though that might complicate this, but I will try it out now.

Just to elaborate a bit more. This code is inside a web service, our application is in .Net 3.5, so we made a web service in .Net 4.0 to use the SDK. This web service allows us to call the .Net 4.0 functions from our .Net 3.5 code.

 

If the session can be passed around through web services this solution is perfect.
If this won't work other suggestions would be appreciated.

Thanks.

0 0
replied on April 4, 2019 Show version history

If passing the session doesn't work, then passing the ticket might not work either.

It is also worth noting that Tickets are Directory Server objects, not application server or repository objects.

I've never created a Ticket object before so there may be things I'm missing, but I believe it involves these steps.

  1. Create a TicketRequestSettings object
  2. Set the username, password, ticket server, etc.
  3. Create the ticket using TicketFactory.GetTicket

 

This would require a reference to Laserfiche.SecurityTokenService, and the TicketServer would be the directory server, not the application server.

0 0
replied on April 4, 2019

It is looking like I cannot pass the session object through the web service.
 

I was hopeful about the "Ticket" class because it has the property "TokenXml", and a constructor that takes in tokenXml. Which would let me pass around the "string" value of the Ticket without problems.

I'm going to experiment with the "TicketFactory.GetTicket" method and see if I can generate tickets to use.

0 0
replied on April 14, 2020

Hey @████████, were you able to generate a ticket using the TicketFactory? 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.