Skip to content

RohitKandimalla/measure-authoring-tool-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Measure Authoring Tool Server

Installation

$ mvn install

Testing

# Run Unit Tests
$ mvn test

# Run PMD Linter
$ mvn site

Authentication

Default Authentication Data

Adding user data for testing purposes can be confusing. Here are two queries to run that will set you up for testing.

Add a client

# This will create a client with the cilent id test, the client secret user, the redirect uri as http://localhost:3000/oauth2/callback, and autoapprove

CREATE TABLE IF NOT EXISTS Account(id LONG,
                                    isActive BOOLEAN,
                                    password VARCHAR(255),
                                    username VARCHAR(255));

INSERT INTO OAUTH_CLIENT_DETAILS(CLIENT_ID, RESOURCE_IDS, CLIENT_SECRET, SCOPE, AUTHORIZED_GRANT_TYPES, AUTHORITIES, ACCESS_TOKEN_VALIDITY, REFRESH_TOKEN_VALIDITY, WEB_SERVER_REDIRECT_URI, autoapprove)
VALUES ('user', 'api','$2a$10$BurTWIy5NTF9GJJH4magz.9Bd4bBurWYG8tmXxeQh1vs7r/wnCFG2','write', 'authorization_code', 'USER', 10800, 2592000, "http://localhost:3000/oauth2/callback", "true");

Add a user

# This will create a user in the account table with the username test and the password password
INSERT INTO `Account` (`id`,`isActive`,`password`,`username`) VALUES (1,'1','$2a$10$f226euUthknnno/VVaIQZ.D.gK0UtMlo5u866jVHUNSAdSqAUzBJ6','test');

Testing with Postman

Use the following settings for Postman OAuth2 Testing

In the Authorization tab, select OAuth 2.0. Then click new access token.

Token Name = Token, Grant Type = Authorization Code, Callback URL = http://localhost:3000/oauth2/callback Auth URL = http://localhost:8080/oauth/authorize, Access Token URL = http://localhost:8080/oauth/token, Client ID = user, Client Secret = user, Scope = write

About

POC for Spring Boot backend (REST API) for the Measure Authoring Tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 78.9%
  • XSLT 20.0%
  • Other 1.1%