> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.vlenseg.com/llms.txt.
> For full documentation content, see https://docs.vlenseg.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.vlenseg.com/_mcp/server.

# Verify OAuth token during registration

POST https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken
Content-Type: application/json

Verify an OAuth ID token (from Google or Microsoft) as part of the registration flow. On success, returns an `oAuthTokenVerificationRequestId` — pass this in the `/Register` body to skip the email verification step.

**Setup required in the Vlens portal** before using OAuth providers. See the Google Cloud Platform Console and Azure AD B2C documentation for configuring OAuth client credentials.

**Supported providers:**
- **Google** — configure via Google Cloud Platform Console
- **Microsoft** — configure via Azure AD B2C


Reference: https://docs.vlenseg.com/api-reference/vlens-api/registration/register-step-verify-o-auth-token

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: example-openapi
  version: 1.0.0
paths:
  /api/DigitalIdentity/Register/StepVerifyOAuthToken:
    post:
      operationId: register-step-verify-o-auth-token
      summary: Verify OAuth token during registration
      description: >
        Verify an OAuth ID token (from Google or Microsoft) as part of the
        registration flow. On success, returns an
        `oAuthTokenVerificationRequestId` — pass this in the `/Register` body to
        skip the email verification step.


        **Setup required in the Vlens portal** before using OAuth providers. See
        the Google Cloud Platform Console and Azure AD B2C documentation for
        configuring OAuth client credentials.


        **Supported providers:**

        - **Google** — configure via Google Cloud Platform Console

        - **Microsoft** — configure via Azure AD B2C
      tags:
        - subpackage_registration
      parameters:
        - name: ApiKey
          in: header
          description: >-
            Static API key issued to your tenant. Obtain from the Vlens
            dashboard.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: >-
            Token verified. Use the returned `oAuthTokenVerificationRequestId`
            in the `/Register` call.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiOutputOAuthVerify'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OAuthVerifyInput'
servers:
  - url: https://api.vlenseg.com
components:
  schemas:
    OAuthVerifyInputProvider:
      type: string
      enum:
        - Google
        - Microsoft
      description: The OAuth provider that issued the token.
      title: OAuthVerifyInputProvider
    OAuthVerifyInput:
      type: object
      properties:
        provider:
          $ref: '#/components/schemas/OAuthVerifyInputProvider'
          description: The OAuth provider that issued the token.
        IdToken:
          type: string
          description: >-
            The ID token received from the OAuth provider after the user
            authenticates.
      required:
        - provider
        - IdToken
      description: Verifies an OAuth ID token issued by Google or Microsoft.
      title: OAuthVerifyInput
    OAuthVerifyOutput:
      type: object
      properties:
        oAuthTokenVerificationRequestId:
          type: string
          format: uuid
          description: >-
            Save this and pass it as `oAuthTokenVerificationRequestId` in the
            `/Register` body to skip email verification.
        isVerified:
          type: boolean
          description: Whether the token was successfully verified with the provider.
        validationResult:
          type:
            - string
            - 'null'
          description: Human-readable result message from the provider.
        email:
          type:
            - string
            - 'null'
          format: email
          description: Email address extracted from the verified token.
      title: OAuthVerifyOutput
    ApiOutputOAuthVerify:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/OAuthVerifyOutput'
        error_code:
          type:
            - integer
            - 'null'
        error_message:
          type:
            - string
            - 'null'
        error_descriptions:
          oneOf:
            - description: Any type
            - type: 'null'
      title: ApiOutputOAuthVerify
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: ApiKey
      description: Static API key issued to your tenant. Obtain from the Vlens dashboard.

```

## SDK Code Examples

```python Registration_registerStepVerifyOAuthToken_example
import requests

url = "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Registration_registerStepVerifyOAuthToken_example
const url = 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Registration_registerStepVerifyOAuthToken_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("ApiKey", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Registration_registerStepVerifyOAuthToken_example
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Registration_registerStepVerifyOAuthToken_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Registration_registerStepVerifyOAuthToken_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken', [
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Registration_registerStepVerifyOAuthToken_example
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Registration_registerStepVerifyOAuthToken_example
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Google OAuth token
import requests

url = "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

payload = {
    "provider": "Google",
    "IdToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE..."
}
headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Google OAuth token
const url = 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"provider":"Google","IdToken":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE..."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Google OAuth token
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

	payload := strings.NewReader("{\n  \"provider\": \"Google\",\n  \"IdToken\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE...\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("ApiKey", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Google OAuth token
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"provider\": \"Google\",\n  \"IdToken\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE...\"\n}"

response = http.request(request)
puts response.read_body
```

```java Google OAuth token
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"provider\": \"Google\",\n  \"IdToken\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE...\"\n}")
  .asString();
```

```php Google OAuth token
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken', [
  'body' => '{
  "provider": "Google",
  "IdToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE..."
}',
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Google OAuth token
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"provider\": \"Google\",\n  \"IdToken\": \"eyJhbGciOiJSUzI1NiIsImtpZCI6IjE...\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Google OAuth token
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "provider": "Google",
  "IdToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6IjE..."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

```python Microsoft OAuth token
import requests

url = "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

payload = {
    "provider": "Microsoft",
    "IdToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI..."
}
headers = {
    "ApiKey": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Microsoft OAuth token
const url = 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken';
const options = {
  method: 'POST',
  headers: {ApiKey: '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"provider":"Microsoft","IdToken":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI..."}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Microsoft OAuth token
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken"

	payload := strings.NewReader("{\n  \"provider\": \"Microsoft\",\n  \"IdToken\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI...\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("ApiKey", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Microsoft OAuth token
require 'uri'
require 'net/http'

url = URI("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["ApiKey"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"provider\": \"Microsoft\",\n  \"IdToken\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI...\"\n}"

response = http.request(request)
puts response.read_body
```

```java Microsoft OAuth token
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")
  .header("ApiKey", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"provider\": \"Microsoft\",\n  \"IdToken\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI...\"\n}")
  .asString();
```

```php Microsoft OAuth token
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken', [
  'body' => '{
  "provider": "Microsoft",
  "IdToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI..."
}',
  'headers' => [
    'ApiKey' => '<apiKey>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Microsoft OAuth token
using RestSharp;

var client = new RestClient("https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken");
var request = new RestRequest(Method.POST);
request.AddHeader("ApiKey", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"provider\": \"Microsoft\",\n  \"IdToken\": \"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI...\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Microsoft OAuth token
import Foundation

let headers = [
  "ApiKey": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "provider": "Microsoft",
  "IdToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI..."
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.vlenseg.com/api/DigitalIdentity/Register/StepVerifyOAuthToken")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```