Skip to content

Attempt to authenticate so I can query candidates in the system #49

@bnbon

Description

@bnbon

Hi,

I am using React (react-boilerplate) and this library with the intention to allow visitors to a website to query the candidates in the bullhorn system.

I am aware I will need to hide the variables in use by the system, but regardless I just want to do the above first in a rough and ready way initially.

This is the code I have, with obvious omissions, but the URL for login returns a 404 – yet it is taken exactly from the docs.

import React, { Component } from 'react';
import { Staffing, StaffingCredentialsAuthProvider } from '@bullhorn/taurus';

const provider = new StaffingCredentialsAuthProvider(
  'USERNAME',
  'PASSWORD',
);

const staffing = new Staffing({
  useCookies: false,
  client_id: 'CLIENT_ID',
  apiVersion: '*',
  redirect_url: 'http://0.0.0.0:3000',
  authorization_url: 'http://auth.bullhornstaffing.com/oauth/authorize',
  token_url: 'http://auth.bullhornstaffing.com/oauth/token',
  login_url: 'http://rest.bullhornstaffing.com/rest-services/login',
});

class SearchPage extends Component {
  doSearch = () => {
    console.log(`Login Attempt`);

    staffing.login(provider).then(() => {
      console.log('2');
      // never reached
    });

    console.log('1');
  };

  render() {
    this.doSearch();

    return (
      <>
          <h1>search</h1>
      </>
    );
  }
}

export default SearchPage;

Are these urls different now - or am I making a mess of this; the documentation is a little unclear, but I would have thought search candidates from the system would be quite straight forward?

Many Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions