#2774 display scopes for oauth2 password flow

This commit is contained in:
Anna Bodnia
2017-03-30 17:49:32 +03:00
parent b34e363ae1
commit 432cd7f965
4 changed files with 9 additions and 7 deletions

4
dist/swagger-ui.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
{"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA67FA;AA4mCA;AAk+BA;AAyiCA;AAo5BA","sourceRoot":""} {"version":3,"file":"swagger-ui.js","sources":["webpack:///swagger-ui.js"],"mappings":"AAAA;AAsoGA;AAy4HA;AA+7FA;AA2mCA;AAm+BA;AAyiCA;AAo5BA","sourceRoot":""}

View File

@@ -10,14 +10,13 @@ export default class Oauth2 extends React.Component {
static propTypes = { static propTypes = {
name: PropTypes.string, name: PropTypes.string,
authorized: PropTypes.object, authorized: PropTypes.object,
configs: PropTypes.object,
getComponent: PropTypes.func.isRequired, getComponent: PropTypes.func.isRequired,
schema: PropTypes.object.isRequired, schema: PropTypes.object.isRequired,
authSelectors: PropTypes.object.isRequired, authSelectors: PropTypes.object.isRequired,
authActions: PropTypes.object.isRequired, authActions: PropTypes.object.isRequired,
errSelectors: PropTypes.object.isRequired, errSelectors: PropTypes.object.isRequired,
errActions: PropTypes.object.isRequired, errActions: PropTypes.object.isRequired,
getConfigs: PropTypes.function getConfigs: PropTypes.any
} }
constructor(props, context) { constructor(props, context) {
@@ -173,7 +172,7 @@ export default class Oauth2 extends React.Component {
} }
{ {
!isAuthorized && flow !== PASSWORD && scopes && scopes.size ? <div className="scopes"> !isAuthorized && scopes && scopes.size ? <div className="scopes">
<h2>Scopes:</h2> <h2>Scopes:</h2>
{ scopes.map((description, name) => { { scopes.map((description, name) => {
return ( return (

View File

@@ -8,6 +8,8 @@ export const PRE_AUTHORIZE_OAUTH2 = "pre_authorize_oauth2"
export const AUTHORIZE_OAUTH2 = "authorize_oauth2" export const AUTHORIZE_OAUTH2 = "authorize_oauth2"
export const VALIDATE = "validate" export const VALIDATE = "validate"
const scopeSeparator = " "
export function showDefinitions(payload) { export function showDefinitions(payload) {
return { return {
type: SHOW_AUTH_POPUP, type: SHOW_AUTH_POPUP,
@@ -77,7 +79,8 @@ export const authorizePassword = ( auth ) => ( { fn, authActions, errActions } )
query: { query: {
grant_type: "password", grant_type: "password",
username, username,
password password,
scopes: encodeURIComponent(auth.scopes.join(scopeSeparator))
} }
} }