Avoid valid security context Exception

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2014 09:00 AM
Hello Everyone!
I am creating a web script to get alfresco session ticket.When i call that web script without user authentication it was giving me error like net.sf.acegisecurity.AuthenticationCredentialsNotFoundException - A valid SecureContext was not provided in the RequestContext.
Is there anyway to avoid this exception?
for e.g
if i use the above description file it is not provide me any exception.
But if I use the webscript like below it will provide me error.Is there any way to avoid valid security Exception?
Please reply if any one have any idea.
Thanks.
I am creating a web script to get alfresco session ticket.When i call that web script without user authentication it was giving me error like net.sf.acegisecurity.AuthenticationCredentialsNotFoundException - A valid SecureContext was not provided in the RequestContext.
Is there anyway to avoid this exception?
for e.g
<webscript> <shortname>Get Alfresco User Ticket</shortname> <description>This method is used to get userinformation ticket.</description> <url>/alfresco/user/ticket</url> <authentication>user</authentication> <transaction>required</transaction> <format default="json">extension</format></webscript>
if i use the above description file it is not provide me any exception.
But if I use the webscript like below it will provide me error.Is there any way to avoid valid security Exception?
<webscript> <shortname>Get Alfresco User Ticket</shortname> <description>This method is used to get useri nformation ticket.</description> <url>/alfresco/user/ticket</url> <format default="json">extension</format> </webscript>
Please reply if any one have any idea.
Thanks.
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2014 01:46 AM
Why do you write a custom webscript to get user ticket? I didn't think it would be necessary.
After you login with any user using webscript api,you can get the ticket,and during the session you can use it do whatever you want to.
After you login with any user using webscript api,you can get the ticket,and during the session you can use it do whatever you want to.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2014 01:56 AM
Thanks for your reply.
But when i used the alfresco webscript api i have to pass the username and password and I am using single sign on functionality.So it is not possible for me to get usename or password.
Is there any solution to get user ticket withour providing username and password.
Thanks.
But when i used the alfresco webscript api i have to pass the username and password and I am using single sign on functionality.So it is not possible for me to get usename or password.
Is there any solution to get user ticket withour providing username and password.
Thanks.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2014 12:41 AM
Hi rutaveejshah,
I believe, In your SSO once user is authenticated you must be executing your webscript with - "wcservice" so script gets executed with same/current user's session.
You can get ticket in your script with js api
Hope it helps!
I believe, In your SSO once user is authenticated you must be executing your webscript with - "wcservice" so script gets executed with same/current user's session.
You can get ticket in your script with js api
${session.ticket}
which calls ServiceRegistry.getAuthenticationService().getCurrentTicket();Hope it helps!
