R/autenticar_tjac.R

Defines functions autenticar_tjac

Documented in autenticar_tjac

#' Autenticar
#'
#' @param cpf cpf
#' @param senha senha
#'
#' @return NULL
#' @export
#'
autenticar_tjac <- function(cpf = NULL, senha = NULL){

  url<-"https://esaj.tjac.jus.br/sajcas/login?service=https%3A%2F%2Fesaj.tjac.jus.br%2Fesaj%2Fj_spring_cas_security_check"

conteudo<-httr::GET(url) %>%
      httr::content()


execucao<-xml2::xml_find_first(conteudo,"//*[@name='execution']") %>%
          xml2::xml_attr("value")


body <-
  list(
    username = cpf,
    password = senha,
    lt = "",
    execution = execucao,
    `_eventId` = "submit",
    pbEntrar= "Entrar",
    signature= "",
    certificadoSelecionado = "",
    certificado = ""
  )

url2<-"https://esaj.tjac.jus.br/sajcas/login?service=https%3A%2F%2Fesaj.tjac.jus.br%2Fesaj%2Fj_spring_cas_security_check"

httr::POST(url2,body=body,encode="form")
return(NULL)
}
jjesusfilho/tjac documentation built on Feb. 5, 2020, 11:04 a.m.