github.com/Axway/agent-sdk@v1.1.101/pkg/authz/oauth/tlsclientauthenticator.go (about)

     1  package oauth
     2  
     3  import "net/url"
     4  
     5  type tlsClientAuthenticator struct {
     6  	clientID string
     7  	scope    string
     8  }
     9  
    10  func (p *tlsClientAuthenticator) prepareRequest() (url.Values, map[string]string, error) {
    11  	v := url.Values{
    12  		metaGrantType: []string{GrantTypeClientCredentials},
    13  		metaClientID:  []string{p.clientID},
    14  	}
    15  
    16  	if p.scope != "" {
    17  		v.Add(metaScope, p.scope)
    18  	}
    19  	return v, nil, nil
    20  }