TeamFoundationOAuthService.CreateToken Method (TeamFoundationRequestContext, Identity, String, OAuthTokenType, String)
CreateToken will create a new access token for the identity specified. It will be saved with the identity with the description that was supplied.
Namespace: Microsoft.TeamFoundation.Framework.Server
Assembly: Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)
Syntax
'Declaration
Public Function CreateToken ( _
requestContext As TeamFoundationRequestContext, _
identity As Identity, _
clientId As String, _
tokenType As OAuthTokenType, _
redirectUri As String _
) As OAuthToken
public OAuthToken CreateToken(
TeamFoundationRequestContext requestContext,
Identity identity,
string clientId,
OAuthTokenType tokenType,
string redirectUri
)
public:
OAuthToken^ CreateToken(
TeamFoundationRequestContext^ requestContext,
Identity^ identity,
String^ clientId,
OAuthTokenType tokenType,
String^ redirectUri
)
member CreateToken :
requestContext:TeamFoundationRequestContext *
identity:Identity *
clientId:string *
tokenType:OAuthTokenType *
redirectUri:string -> OAuthToken
public function CreateToken(
requestContext : TeamFoundationRequestContext,
identity : Identity,
clientId : String,
tokenType : OAuthTokenType,
redirectUri : String
) : OAuthToken
Parameters
requestContext
Type: Microsoft.TeamFoundation.Framework.Server.TeamFoundationRequestContextRequest Context may be any host type.
identity
Type: Microsoft.VisualStudio.Services.Identity.IdentityIdentity to generate the access token for.
clientId
Type: System.StringThis defines which application the token is being generated for.
tokenType
Type: Microsoft.TeamFoundation.Framework.Server.OAuthTokenTypeThe type of token required. See types in the OAuthTokenType class.
redirectUri
Type: System.StringRedirection Uri associated with the token.
Return Value
Type: Microsoft.TeamFoundation.Framework.Server.OAuthToken
Returns OAuthToken.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.