Reference Guide
.NET SDK Reference
Resource Information
Namespace: | Autodesk.Authentication |
Assembly: | Autodesk.Authentication.dll |
Version: | 1.0.0 |
Installing this Library
The recommended way of installing this library to your .NET project is to use the NuGet Package Manager.
- Within the NuGet Package Manager locate the Autodesk.Authentication library.
- Follow the instructions on the NuGet documentation site to install the library.
Alternatively, from Visual Studio IDE or CLI tools:
dotnet add package Autodesk.Authentication
Learning Resources
Source Code
The source code for this library is available at https://github.com/autodesk-platform-services/aps-sdk-net.
Tutorials
See the Authentication step of the following tutorials:
Code Sample
AuthenticationClient authenticationClient = null!;
string client_id = "<client_id>";
string client_secret = "<client_secret>";
public void Initialise()
{
// Instantiate SDK manager as below.
SDKManager sdkManager = SdkManagerBuilder
.Create() // Creates SDK Manager Builder itself.
.Build();
// Instantiate AuthenticationClient using the created SDK manager
authenticationClient = new AuthenticationClient(sdkManager);
}
public async Task Get2LeggedTokenAsync()
{
// Get 2Legged token.
// Pass the client Id and secret as in your app. The method
// will convert it in '${Base64(<client_id>:<client_secret>)}' format
TwoLeggedToken twoLeggedToken = await authenticationClient.GetTwoLeggedTokenAsync(client_id, client_secret, new List < Scopes > () {
Scopes.DataRead, Scopes.BucketRead
});
}
Show More
SDK to REST API Cross Reference
Operation Category | Operation | Method | HTTP Request |
---|---|---|---|
Token | Get OIDC Specification | GetOidcSpecAsync | GET /.well-known/openid-configuration |
Authorize User | Authorize | GET /authorize | |
Get JWKS | GetKeysAsync | GET /keys | |
Logout | Logout | GET /logout | |
Get Refresh Token | RefreshTokenAsync | ||
Get Three Legged Token | GetThreeLeggedTokenAsync | ||
Get Two Legged Token | GetTwoLeggedTokenAsync | ||
Introspect Token | IntrospectTokenAsync | GET /introspect | |
Revoke Token | RevokeAsync | POST /revoke | |
Users | Get User Info | GetUserInfoAsync | GET /userinfo |