General Security Access Denied Error

P

Parth

Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
S

Stephen Sanderlin

You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
 
P

Parth

Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

Stephen Sanderlin said:
You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
S

Stephen Sanderlin

Nothing is wrong, per se... it depends on what you have set for the
various variables in your code. The biggest thing to remember when
working with the Statusing PSI is that it only allows operations for the
current user. This means that most of the time you need to use
impersonation. In general, when you receive a
GeneralSecurityAccessDenied exception when calling UpdateStatus it's
because you are trying to update the status of an assignment not owned
by the user you are authenticated as.

Since you are using DefaultCredentials in your application, an excellent
example would be if you are running this application as
DOMAIN\ssanderlin but you are trying to update an assignment for
DOMAIN\parth. This will not work. You would need to change the code to
use impersonation so that the PSI believes you are DOMAIN\parth and then
execute UpdateStatus.

There is a great deal of documentation in the SDK and on the net about
using impersonation... give it a shot. If you run into a problem
implementing impersonation in your code, let us know and we will get it
fixed up for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

:

You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
P

Parth

Hi,

Thanks for the Reply & sorry for the delay from my side.


Certainly i will use Impersonation and Let you know about that what has
happend,

but mean while i was using Administrator's Account, and trying to update the
task Of other users using this account my doubt is still i will receive this
Error even if i an using Administrator's Account


I think it might just happen that Admin doesnt have proper Right to Update,
I will let that you know as well.

Thanks again for the Replies and spending your time for my Problem.

Parth

Stephen Sanderlin said:
Nothing is wrong, per se... it depends on what you have set for the
various variables in your code. The biggest thing to remember when
working with the Statusing PSI is that it only allows operations for the
current user. This means that most of the time you need to use
impersonation. In general, when you receive a
GeneralSecurityAccessDenied exception when calling UpdateStatus it's
because you are trying to update the status of an assignment not owned
by the user you are authenticated as.

Since you are using DefaultCredentials in your application, an excellent
example would be if you are running this application as
DOMAIN\ssanderlin but you are trying to update an assignment for
DOMAIN\parth. This will not work. You would need to change the code to
use impersonation so that the PSI believes you are DOMAIN\parth and then
execute UpdateStatus.

There is a great deal of documentation in the SDK and on the net about
using impersonation... give it a shot. If you run into a problem
implementing impersonation in your code, let us know and we will get it
fixed up for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

:

You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
S

Stephen Sanderlin

No problem -- glad to help. You cannot submit status on other people's
assignments, regardless of whether you are an admin or not.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi,

Thanks for the Reply & sorry for the delay from my side.


Certainly i will use Impersonation and Let you know about that what has
happend,

but mean while i was using Administrator's Account, and trying to update the
task Of other users using this account my doubt is still i will receive this
Error even if i an using Administrator's Account


I think it might just happen that Admin doesnt have proper Right to Update,
I will let that you know as well.

Thanks again for the Replies and spending your time for my Problem.

Parth

:

Nothing is wrong, per se... it depends on what you have set for the
various variables in your code. The biggest thing to remember when
working with the Statusing PSI is that it only allows operations for the
current user. This means that most of the time you need to use
impersonation. In general, when you receive a
GeneralSecurityAccessDenied exception when calling UpdateStatus it's
because you are trying to update the status of an assignment not owned
by the user you are authenticated as.

Since you are using DefaultCredentials in your application, an excellent
example would be if you are running this application as
DOMAIN\ssanderlin but you are trying to update an assignment for
DOMAIN\parth. This will not work. You would need to change the code to
use impersonation so that the PSI believes you are DOMAIN\parth and then
execute UpdateStatus.

There is a great deal of documentation in the SDK and on the net about
using impersonation... give it a shot. If you run into a problem
implementing impersonation in your code, let us know and we will get it
fixed up for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

:


You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com





Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
P

Parth

Hi,

This amazed me cause in the project Server i am able to RE- Publish any
project, ???

and i have tried using Impesonation but i am making some mistakes i guess
can you put some pseudo code for this, it would be much help ful to me as i
am new bee to this.....:)

Thanks in Advance.

Parth

Stephen Sanderlin said:
No problem -- glad to help. You cannot submit status on other people's
assignments, regardless of whether you are an admin or not.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi,

Thanks for the Reply & sorry for the delay from my side.


Certainly i will use Impersonation and Let you know about that what has
happend,

but mean while i was using Administrator's Account, and trying to update the
task Of other users using this account my doubt is still i will receive this
Error even if i an using Administrator's Account


I think it might just happen that Admin doesnt have proper Right to Update,
I will let that you know as well.

Thanks again for the Replies and spending your time for my Problem.

Parth

:

Nothing is wrong, per se... it depends on what you have set for the
various variables in your code. The biggest thing to remember when
working with the Statusing PSI is that it only allows operations for the
current user. This means that most of the time you need to use
impersonation. In general, when you receive a
GeneralSecurityAccessDenied exception when calling UpdateStatus it's
because you are trying to update the status of an assignment not owned
by the user you are authenticated as.

Since you are using DefaultCredentials in your application, an excellent
example would be if you are running this application as
DOMAIN\ssanderlin but you are trying to update an assignment for
DOMAIN\parth. This will not work. You would need to change the code to
use impersonation so that the PSI believes you are DOMAIN\parth and then
execute UpdateStatus.

There is a great deal of documentation in the SDK and on the net about
using impersonation... give it a shot. If you run into a problem
implementing impersonation in your code, let us know and we will get it
fixed up for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

:
You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com
Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 
S

Stephen Sanderlin

The Statusing web service was designed for use from the Outlook plug-in,
so it only handles operations for the currently authenticated user.

Here's a high-level overview of what you need to do to lay the
foundation for impersonation:
1) Add a web reference to Statusing web service.
2) Create a derived class of the Statusing class that inherits from the
Statusing class in the web reference (e.g. StatusingDerived).
3) Follow Procedure #3 at
http://msdn.microsoft.com/en-us/library/aa974413.aspx to complete the
derived class.

See Procedure #4 in the above link for an actual impersonation
application. Essentially you'll want to:
1) Use the GetResourceUid method in Step 3 of Procedure #4 to retrieve
the GUID of the resource you want to impersonate.
2) Create and configure an instance of the StatusingDerived class.
3) Call the SetImpersonationContext method of the StatusingDerived
class.
4) Generate the changeXml for the status update.
5) Call the UpdateStatus method of StatusingDerived and pass in the
changeXml you just generated.
6) Call the SubmitStatus method of the StatusingDerived class and pass
in the assignment GUID of the assignment you just updated.

Non-impersonated sample code for UpdateStatus and SubmitStatus can be
found here:
http://msdn.microsoft.com/en-us/library/websvcstatusing.statusing.updatestatus.aspx,
and guidance on changeXml can be found here:
http://msdn.microsoft.com/en-us/library/bb428819.aspx and here:
http://msdn.microsoft.com/en-us/library/bb428836.aspx.

If you have any specific questions on the impersonation, please feel
free to post your impersonation method up to the NG and I'll be glad to
help with it.

Fortunately or otherwise, you have chosen to undertake one of the more
complicated aspects of PS Development... if you are having a lot of
trouble with this, you may want to consider hiring an experienced PS
development consultant to do this work for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi,

This amazed me cause in the project Server i am able to RE- Publish any
project, ???

and i have tried using Impesonation but i am making some mistakes i guess
can you put some pseudo code for this, it would be much help ful to me as i
am new bee to this.....:)

Thanks in Advance.

Parth

:

No problem -- glad to help. You cannot submit status on other people's
assignments, regardless of whether you are an admin or not.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com



Hi,

Thanks for the Reply & sorry for the delay from my side.


Certainly i will use Impersonation and Let you know about that what has
happend,

but mean while i was using Administrator's Account, and trying to update the
task Of other users using this account my doubt is still i will receive this
Error even if i an using Administrator's Account


I think it might just happen that Admin doesnt have proper Right to Update,
I will let that you know as well.

Thanks again for the Replies and spending your time for my Problem.

Parth

:


Nothing is wrong, per se... it depends on what you have set for the
various variables in your code. The biggest thing to remember when
working with the Statusing PSI is that it only allows operations for the
current user. This means that most of the time you need to use
impersonation. In general, when you receive a
GeneralSecurityAccessDenied exception when calling UpdateStatus it's
because you are trying to update the status of an assignment not owned
by the user you are authenticated as.

Since you are using DefaultCredentials in your application, an excellent
example would be if you are running this application as
DOMAIN\ssanderlin but you are trying to update an assignment for
DOMAIN\parth. This will not work. You would need to change the code to
use impersonation so that the PSI believes you are DOMAIN\parth and then
execute UpdateStatus.

There is a great deal of documentation in the SDK and on the net about
using impersonation... give it a shot. If you run into a problem
implementing impersonation in your code, let us know and we will get it
fixed up for you.

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com





Hi
i am not using Queing Service just a Naming Convention Error....Sorry....:(

and the Error only says General Security Access Denied that's it,

is there anything wrong with my code.

and can you help me create a Windows App or is there any code available for
Win App so that i will run this on Admin USer only.

if you can please help me out.

Thanks

Parth

:



You appear to be using the QUEUEWEBSERVICE path for the Statusing web
service... Also, does the user account you are running the application
as have access to the application?

Can you post the full error you receive when attempting to execute this
code?

--
Stephen Sanderlin
Principal Consultant
MSProjectExperts

For Project Server Consulting: http://www.msprojectexperts.com
For Project Server Training: http://www.projectservertraining.com

Read my blog at: http://www.projectserverhelp.com
Join the community at: http://forums.epmfaq.com






Please Review the Following Code:
I am getting Error at the UpdateStatus Method:

Guid assn = new Guid(((Label)gvr.FindControl("lblAssn")).Text);
string changexml =
((TextBox)gvr.FindControl("lblPSI")).Text;

CookieContainer cookiecontainer = new CookieContainer();

login.Url = baseurl + LOGINWINDOWS;
login.Credentials =
System.Net.CredentialCache.DefaultCredentials;
login.CookieContainer = cookiecontainer;
login.UseDefaultCredentials = true;

sta.Url = baseurl + QUEUEWEBSERVICE;
sta.Credentials =
System.Net.CredentialCache.DefaultCredentials;
sta.CookieContainer = cookiecontainer;
sta.UseDefaultCredentials = true;


//sta.CookieContainer = cookiecontainer;


sta.UpdateStatus(changexml.ToString());
sta.SubmitStatus(new Guid[] { assn }, "Har Har Mahadev");
Label1.Text = "Update Succesfully";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top