import React, { PureComponent } from 'react' import {Alert, InputGroup, Navbar, Nav, NavItem, NavDropdown, MenuItem, Glyphicon, Jumbotron, Button} from 'react-bootstrap' import {Panel, Row, Col, Collapse, FormControl, FormGroup, ControlLabel, HelpBlock} from 'react-bootstrap' import FontAwesome from 'react-fontawesome' import WhiteBox from './WhiteBox' class Component extends PureComponent { constructor(props) { super(props) // console.log("--- props", this.props) // With these Location object properties you can access all of these URL components // // hash - Sets or returns the anchor portion of a URL. // host - Sets or returns the hostname and port of a URL. // hostname - Sets or returns the hostname of a URL. // href - Sets or returns the entire URL. // pathname - Sets or returns the path name of a URL. // port - Sets or returns the port number the server uses for a URL. // protocol - Sets or returns the protocol of a URL. // search - Sets or returns the query portion of a URL var currentURL = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '' ) + '/callback' // console.log("currentURL", currentURL) this.state = { clientId: "6233aedf-f08a-4112-9a1b-f33c3cd9b396", clientSecret: "", redirectURL: currentURL, scopes: "", response_type: "token" } } authenticateStart() { let config = Object.assign({}, this.props.serverConfig, this.state) // console.error("Authenticate", config, this.props.serverConfig, this.state) this.props.authenticateStart(config) } logoutStart() { this.props.logoutStart() } updateFieldHandler(field) { return (e) => { this.setState({ [field]: e.target.value }) } } render() { // console.log("X This props", this.props) // console.log("X This state", this.state) let authorizationEndpoint = '' if (this.state.authorizationEndpoint) { authorizationEndpoint = this.state.authorizationEndpoint } else if (this.props.serverConfig) { authorizationEndpoint = this.props.serverConfig.authorization_endpoint } let tokenEndpoint = '' if (this.state.tokenEndpoint) { tokenEndpoint = this.state.tokenEndpoint } else if (this.props.serverConfig) { tokenEndpoint = this.props.serverConfig.token_endpoint } let userinfoEndpoint = '' if (this.state.userinfoEndpoint) { userinfoEndpoint = this.state.userinfoEndpoint } else if (this.props.serverConfig) { userinfoEndpoint = this.props.serverConfig.userinfo_endpoint } let expanded = !!this.props.serverConfig return (

OAuth Authorization endpoint

OAuth Token endpoint

Userinfo Endpoint

Client ID

Client secret

Scopes

Response Type

Redirect URI

When you configure your client, please register the following redirect uri:

{this.state.redirectURL}

 
) } } export default Component