Package org.kohsuke.github.authorization
Class AppInstallationAuthorizationProvider
- java.lang.Object
-
- org.kohsuke.github.GitHub.DependentAuthorizationProvider
-
- org.kohsuke.github.authorization.AppInstallationAuthorizationProvider
-
- All Implemented Interfaces:
AuthorizationProvider
- Direct Known Subclasses:
OrgAppInstallationAuthorizationProvider
public class AppInstallationAuthorizationProvider extends GitHub.DependentAuthorizationProvider
An AuthorizationProvider that performs automatic token refresh for an organization's AppInstallation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AppInstallationAuthorizationProvider.AppInstallationProvider
Provides an interface that returns an app to be used by an AppInstallationAuthorizationProvider
-
Field Summary
-
Fields inherited from interface org.kohsuke.github.authorization.AuthorizationProvider
ANONYMOUS
-
-
Constructor Summary
Constructors Constructor Description AppInstallationAuthorizationProvider(AppInstallationAuthorizationProvider.AppInstallationProvider appInstallationProvider, AuthorizationProvider authorizationProvider)
Provides an AuthorizationProvider that performs automatic token refresh, based on an previously authenticated github client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEncodedAuthorization()
Returns the credentials to be used with a given request.-
Methods inherited from class org.kohsuke.github.GitHub.DependentAuthorizationProvider
gitHub
-
-
-
-
Constructor Detail
-
AppInstallationAuthorizationProvider
@BetaApi public AppInstallationAuthorizationProvider(AppInstallationAuthorizationProvider.AppInstallationProvider appInstallationProvider, AuthorizationProvider authorizationProvider)
Provides an AuthorizationProvider that performs automatic token refresh, based on an previously authenticated github client.- Parameters:
appInstallationProvider
- An AppInstallationProvider that the authorization provider will use to retrieve the App.authorizationProvider
- A authorization provider that returns a JWT token that can be used to refresh the App Installation token from GitHub.
-
-
Method Detail
-
getEncodedAuthorization
public String getEncodedAuthorization() throws IOException
Description copied from interface:AuthorizationProvider
Returns the credentials to be used with a given request. As an example, a authorization provider for a bearer token will return something like:@Override public String getEncodedAuthorization() { return "Bearer myBearerToken"; }
- Returns:
- encoded authorization string, can be null
- Throws:
IOException
- on any error that prevents the provider from returning a valid authorization
-
-