Package io.apicurio.rest.client.auth
Class OidcAuth
- java.lang.Object
-
- io.apicurio.rest.client.auth.OidcAuth
-
- All Implemented Interfaces:
Auth,AutoCloseable
public class OidcAuth extends Object implements Auth, AutoCloseable
- Author:
- carnalca@redhat.com
-
-
Constructor Summary
Constructors Constructor Description OidcAuth(ApicurioHttpClient httpClient, String clientId, String clientSecret)OidcAuth(ApicurioHttpClient httpClient, String clientId, String clientSecret, Duration tokenExpirationReduction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Map<String,String> requestHeaders)Called to apply this auth mechanism to the HTTP request headers.Stringauthenticate()voidclose()StringobtainAccessTokenPasswordGrant(String username, String password)
-
-
-
Constructor Detail
-
OidcAuth
public OidcAuth(ApicurioHttpClient httpClient, String clientId, String clientSecret)
-
OidcAuth
public OidcAuth(ApicurioHttpClient httpClient, String clientId, String clientSecret, Duration tokenExpirationReduction)
-
-
Method Detail
-
apply
public void apply(Map<String,String> requestHeaders)
Description copied from interface:AuthCalled to apply this auth mechanism to the HTTP request headers. Typically an implementation would add an "Authorization" header or something similar.- Specified by:
applyin interfaceAuth- See Also:
Auth.apply(java.util.Map)
-
authenticate
public String authenticate()
-
obtainAccessTokenPasswordGrant
public String obtainAccessTokenPasswordGrant(String username, String password)
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
-