---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/api-reference

 Release :

    - australia

ft:locale :

    - de-DE

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideOAuthClientRequest - Scoped, Global

# GlideOAuthClientRequest - Scoped, Global {#ariaid-title1}

* Freigeben Version: Australia
* 
* Aktualisiert 12. März 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 Minuten Lesedauer

The GlideOAuthClientRequest API provides methods for handling OAuth
client requests.

You can use this API in global and scoped scripts. In scoped scripts use the `sn_auth` namespace identifier.

## GlideOAuthClientRequest - getGrantType() {#ariaid-title2}

Retrieves the grant type.
{#r_GlideOAuthClientRequestGetGrantType__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 1. Parameters]

{#r_GlideOAuthClientRequestGetGrantType__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetGrantType__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The grant type. |
[Tabelle : 2. Returns]

{#r_GlideOAuthClientRequestGetGrantType__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getHeader(String name) {#ariaid-title3}

Retrieves the HTTP headers for the string you provide.
{#r_GlideOAuthClientRequestGetHeader__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The name of the parameter. |
[Tabelle : 3. Parameters]

{#r_GlideOAuthClientRequestGetHeader__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetHeader__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| StringMap | The string map with the HTTP headers. |
[Tabelle : 4. Returns]

{#r_GlideOAuthClientRequestGetHeader__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getHeaders() {#ariaid-title4}

Retrieves the HTTP headers.
{#r_GlideOAuthClientRequestGetHeaders__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 5. Parameters]

{#r_GlideOAuthClientRequestGetHeaders__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetHeaders__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| StringMap | The string map with the HTTP headers. |
[Tabelle : 6. Returns]

{#r_GlideOAuthClientRequestGetHeaders__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getParameter(String name) {#ariaid-title5}

Retrieves the parameters for the parameter name you provide.
{#r_GlideOAuthClientRequestGetParameter__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The parameter name for which you want the parameters. |
[Tabelle : 7. Parameters]

{#r_GlideOAuthClientRequestGetParameter__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetParameter__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The parameters. |
[Tabelle : 8. Returns]

{#r_GlideOAuthClientRequestGetParameter__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getPassword() {#ariaid-title6}

Retrieves the password.
{#r_GlideOAuthClientRequestGetPassword__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 9. Parameters]

{#r_GlideOAuthClientRequestGetPassword__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetPassword__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The password. |
[Tabelle : 10. Returns]

{#r_GlideOAuthClientRequestGetPassword__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getRefreshToken() {#ariaid-title7}

Retrieves the refresh token.
{#r_GlideOAuthClientRequestGetRefreshToken__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 11. Parameters]

{#r_GlideOAuthClientRequestGetRefreshToken__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetRefreshToken__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The refresh token. |
[Tabelle : 12. Returns]

{#r_GlideOAuthClientRequestGetRefreshToken__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getScope() {#ariaid-title8}

Retrieves the scope.
{#r_GlideOAuthClientRequestGetScope__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 13. Parameters]

{#r_GlideOAuthClientRequestGetScope__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetScope__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The scope. |
[Tabelle : 14. Returns]

{#r_GlideOAuthClientRequestGetScope__table_rc4_bzf_cr}

## GlideOAuthClientRequest - getUserName() {#ariaid-title9}

Retrieves the user name.
{#r_GlideOAuthClientRequestGetUserName__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| none |   |   |
[Tabelle : 15. Parameters]

{#r_GlideOAuthClientRequestGetUserName__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestGetUserName__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| String | The user name. |
[Tabelle : 16. Returns]

{#r_GlideOAuthClientRequestGetUserName__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setGrantType(String grantType) {#ariaid-title10}

Sets the grant type for the string you provide.
Hinweis:  
You only need to set the grant type if it is not already defined in the OAuth provider profile.
{#r_GlideOAuthClientRequestSetGrantType__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The grant type. |
[Tabelle : 17. Parameters]

{#r_GlideOAuthClientRequestSetGrantType__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetGrantType__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 18. Returns]

{#r_GlideOAuthClientRequestSetGrantType__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setHead(String name, String value) {#ariaid-title11}

Retrieves the HTTP headers for the string you provide.
Hinweis:  
setHead(String name, String value) is used in global. The scoped equivalent of this method is setHeader(String name, String value).
{#r_GlideOAuthClientRequestSetHead__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The name of the parameter. |
| value | String | The value of the parameter. |
[Tabelle : 19. Parameters]

{#r_GlideOAuthClientRequestSetHead__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetHead__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 20. Returns]

{#r_GlideOAuthClientRequestSetHead__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setParameter(String name, String value) {#ariaid-title12}

Sets the parameters for the name:value pair of strings you provide.
{#r_GOACR-SetParameters_N_V__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | The parameter name for which you want the parameters. |
| value | String | The value of the parameter. |
[Tabelle : 21. Parameters]

{#r_GOACR-SetParameters_N_V__table_qc4_bzf_cr} {#r_GOACR-SetParameters_N_V__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 22. Returns]

{#r_GOACR-SetParameters_N_V__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setPassword(String password) {#ariaid-title13}

Sets the password with the string you provide.
{#r_GlideOAuthClientRequestSetPassword__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| password | String | The user name. |
[Tabelle : 23. Parameters]

{#r_GlideOAuthClientRequestSetPassword__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetPassword__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 24. Returns]

{#r_GlideOAuthClientRequestSetPassword__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setRefreshToken(String refreshToken) {#ariaid-title14}

Sets the refresh token with the string you provide.
{#r_GlideOAuthClientRequestSetRefreshToken__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| refreshToken | String | The refresh token. |
[Tabelle : 25. Parameters]

{#r_GlideOAuthClientRequestSetRefreshToken__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetRefreshToken__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 26. Returns]

{#r_GlideOAuthClientRequestSetRefreshToken__table_rc4_bzf_cr}  
This example shows a resource owner password grant type request.


         var tokenRequest =new GlideOAuthClientRequest();
         tokenRequest.setGrantType("password");
         tokenRequest.setUserName("itil");
         tokenRequest.setPassword("itil");
         tokenRequest.setScope(null);
     
         var oAuthClient =new GlideOAuthClient();var tokenResponse = oAuthClient.requestToken("TestClient", tokenRequest);
         gs.log("Error:"+ tokenResponse.getErrorMessage());
     
         var token = tokenResponse.getToken();if(token){
           gs.log("AccessToken:"+ token.getAccessToken());
           gs.log("AccessTokenExpiresIn:"+ token.getExpiresIn());
           gs.log("RefreshToken:"+ token.getRefreshToken());

This example shows a refresh token grant type request.


         var tokenRequest =new GlideOAuthClientRequest();
         tokenRequest.setGrantType("refresh_token");
         tokenRequest.setRefreshToken("N-GtdSVLkWP_Cr-TysXdmNy59ZYafu5ZzAS4YaSluXDm0kCkInEnu-hwM5SsGYSFwKJ6xauVmoaq7xJNoalXFQ");
         tokenRequest.setScope(null);
     
         var oAuthClient =new GlideOAuthClient();
         tokenResponse = oAuthClient.requestToken("TestClient", tokenRequest);
         gs.log("Error:"+ tokenResponse.getErrorMessage());
         token = tokenResponse.getToken();if( token){
            gs.log("AccessToken:"+ token.getAccessToken());
            gs.log("AccessTokenExpiresIn:"+ token.getExpiresIn());
            gs.log("AccessTokenSysID:"+ token.getAccessTokenSysID());
            gs.log("RefreshToken:"+ token.getRefreshToken());
            gs.log("RefreshTokenSysID:"+ token.getRefreshTokenSysID());

## GlideOAuthClientRequest - setScope(String scope) {#ariaid-title15}

Sets the scope for the string you provide.
Hinweis:  
You only need to set the scope if it is not already defined in the OAuth provider.
{#r_GlideOAuthClientRequestSetScope__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| scope | String | The scope. |
[Tabelle : 27. Parameters]

{#r_GlideOAuthClientRequestSetScope__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetScope__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 28. Returns]

{#r_GlideOAuthClientRequestSetScope__table_rc4_bzf_cr}

## GlideOAuthClientRequest - setUserName(String userName) {#ariaid-title16}

Sets the user name with the string you provide.
{#r_GlideOAuthClientRequestSetUserName__table_qc4_bzf_cr__entry__3}

| Name | Type | Description |
|-|-|-|
| userName | String | The user name. |
[Tabelle : 29. Parameters]

{#r_GlideOAuthClientRequestSetUserName__table_qc4_bzf_cr} {#r_GlideOAuthClientRequestSetUserName__table_rc4_bzf_cr__entry__2}

| Type | Description |
|-|-|
| void |   |
[Tabelle : 30. Returns]

{#r_GlideOAuthClientRequestSetUserName__table_rc4_bzf_cr}

