use of io.swagger.models.auth.OAuth2Definition in project ORCID-Source by ORCID.
the class MemberSwaggerResource method scan.
/**
* Scan the classes and add in the OAuth information
*
*/
@Override
protected synchronized Swagger scan(Application app) {
// tell swagger to pick up our jaxb annotations
Json.mapper().registerModule(new JaxbAnnotationModule());
Swagger s = super.scan(app);
OAuth2Definition oauth = new OAuth2Definition();
oauth.accessCode(this.authEndPoint, this.tokenEndPoint);
oauth.scope(ScopePathType.READ_LIMITED.value(), "Read Limited record");
oauth.scope(ScopePathType.PERSON_UPDATE.value(), "Update person");
oauth.scope(ScopePathType.ACTIVITIES_UPDATE.value(), "Update activities");
s.securityDefinition("orcid_auth", oauth);
OAuth2Definition oauthTwoLegs = new OAuth2Definition();
oauthTwoLegs.application(this.tokenEndPoint);
oauthTwoLegs.scope(ScopePathType.PREMIUM_NOTIFICATION.value(), "Notifications");
oauthTwoLegs.scope(ScopePathType.READ_PUBLIC.value(), "Read Public record");
oauthTwoLegs.scope(ScopePathType.GROUP_ID_RECORD_READ.value(), "Read groups");
oauthTwoLegs.scope(ScopePathType.GROUP_ID_RECORD_UPDATE.value(), "Update groups");
s.securityDefinition("orcid_two_legs", oauthTwoLegs);
return s;
}
Aggregations