Get Access Token & Users - OneLogin Developers

See api-docs Menu Version 2 Version 1 Version v1-v3
  • Get Started
    • Developer Overview
    • Authorizing Resource API Calls
    • Working with API Credentials
    • Using Query Parameters
    • Postman Collections
    • Client SDKs
  • OAuth 2.0 Tokens
    • Generate Tokens
    • Revoke Token
    • Get Rate Limit
  • Apps
    • Get Apps
  • Users
    • User Resource
    • Get Users
    • Get User by ID
    • Get Apps for a User
    • Get Roles for a User
    • Get Custom Attributes
    • Create User
    • Delegate Authentication
    • Update User by ID
    • Assign Role to User
    • Remove Role from User
    • Set Password by ID Using Cleartext
    • Set Password by ID Using Salt and SHA-256
    • Set Custom Attribute
    • Set User State
    • Log User Out
    • Lock User Account
    • Delete User by ID
  • Login Pages
    • Log a User In Via API
    • Create Session Login Token
    • Verify Factor
    • Create Session
  • SAML Assertions
    • Generate SAML Assertion
    • Verify Factor
  • Multi-Factor Auth
    • Overview
    • Get Available Factors
    • Enroll a Factor
    • Get Enrolled Factors
    • Activate a Factor
    • Verify a Factor
    • Remove a Factor
    • Generate MFA Token
  • Roles
    • Get Roles
    • Get Role by ID
  • Events
    • Event Resource and Types
    • Get Event Types
    • Get Events
    • Get Event by ID
    • Webhooks
  • Groups
    • Get Groups
    • Get Group by ID
  • Privileges
    • List Privileges
    • Create a Privilege
    • Update a Privilege
    • Get a Privilege
    • Delete a Privilege
    • Get Assigned Roles
    • Assign Roles
    • Remove Role
    • Get Assigned Users
    • Assign Users
    • Remove User
  • Invite Links
    • Generate Invite Link
    • Send Invite Link
  • Embed Apps
    • Get Apps to Embed for a User
  • Samples
    • AWS CLI Assume Role
    • C#
      • Get Access Token and Users
      • Embed Apps
    • Python
      • Work with OAuth 2.0 Tokens, Users, and Roles
      • Create a User
      • Get Events
  1. Home >
  2. API >
  3. 1 >
  4. Samples >
  5. C# >
  6. Get Access Token and Users
Get Access Token and Users

This sample code illustrates how to make a call to the OAuth 2.0 Tokens API using C# to get an access token. As a part of the sample use case, this code also illustrates how to use a generated OAuth 2.0 access token to make various GET calls to the Users API using C#.

This sample code uses RestSharp and JSON.net third-party DLLs.

If you’re using the Generate Tokens v2 API or Refresh Tokens v2 API, replace the API endpoint in the sample with https://<subdomain>/auth/oauth2/v2/token

Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.

Từ khóa » Jwt Vs Oauth2 C#