Loading TOC...

MarkLogic 12 EA 1 Product Documentation
sec:oauth-server

sec:oauth-server(
   $oauth-vendor as xs:string,
   $oauth-flow-type as xs:string,
   $oauth-client-id as xs:string,
   $oauth-token-type as xs:string,
   $oauth-username-attribute as xs:string,
   $oauth-role-attribute as xs:string,
   [$oauth-privilege-attribute as xs:string],
   [$oauth-jwt-issuer-uri as xs:string],
   [$oauth-jwt-alg as xs:string],
   [$oauth-jwt-key-ids as xs:string*],
   [$oauth-jwt-secret-values as xs:string*],
   [$oauth-jwks-uri as xs:string]
) as element(sec:oauth-server)

Summary

This function configures an OAuth server for use by the sec:create-external-security function.

Parameters
oauth-vendor Third-party OAuth 2.0 vendor.
oauth-flow-type OAuth 2.0 flow type.
oauth-client-id Required. OAuth 2.0 Client ID.
oauth-token-type OAuth 2.0 access token format.
oauth-username-attribute Required. The JSON claim name containing username information.
oauth-role-attribute Required. The JSON claim name containing role information.
oauth-privilege-attribute The JSON claim name containing privilege information. Optional.
oauth-jwt-issuer-uri OAuth 2.0 JWT Issuer URI. Required if "OAuth Vendor" is "Microsoft Entra" or "Amazon Cognito".
oauth-jwt-alg Signature algorithm for JWT access tokens. Required if "OAuth Token Type" is "JSON Web Tokens".
oauth-jwt-key-ids List of JWT key-IDs.
oauth-jwt-secret-values List of JWT keys.
oauth-jwks-uri JSON Web Key Sets Endpoint URI.

Usage Notes

This function must be executed against the security database.

Example



(: execute this against the security database :)

xquery version "1.0-ml";
import module namespace sec = "http://marklogic.com/xdmp/security" at "MarkLogic/security.xqy";

sec:oauth-server("Ping Identity",  
                 "Resource server", 
                 "test",
                 "JSON Web Tokens", 
                 "username", 
                 "roles", 
                 "privileges",
                 "",
                 "HS256",
                 ("test1"),
                 ("testsecret1"),
                 "")
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.