question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using rest api error.

See original GitHub issue

Hi. Thank you for this project. It is best for cas auto config. But i have a little problem.

I did a cas-client project with gradle and it looks like good. My application.yml is that:

security:
  basic:
    enabled: false
  ignored: /
  cas:
    paths: /protected
    server:
      base-url: https://localhost:10100/cas
      protocol-version: 2
    service:
      base-url: https://localhost:8443
      paths:
        proxy-callback: /j_spring_cas_security_proxyreceptor

server:
  port: 8443
  ssl:
    enabled: true
    key-store: file:/etc/keystore/localhost.jks
    key-store-password: changeit

Cas server runs on 10100 port. The client web project works good. But i want to access controller to through get and post method.

I try that: (i use postman)

  1. step :
Header:
POST https://localhost:10100/cas/v1/tickets
Content-Type: application/x-www-form-urlencoded
Body:
username=myname&password=123456
  1. step result: Body (html format):
<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">
<html>
    <head>
        <title>201 Created</title>
    </head>
    <body>
        <h1>TGT Created</h1>
        <form action="https://localhost:10100/cas/v1/tickets/TGT-32-NfRV2HIYL6JlqUFTpJuc6EfUyH6q9BImaS0a5CPyOpInrO3fqk-8ee6f154afba" method="POST">Service:
            <input type="text" name="service" value="">
            <br>
            <input type="submit" value="Submit">
        </form>
    </body>
</html>
  1. step: I want to get a service ticket for “https://localhost:8443/protected
Header:
POST https://localhost:10100/cas/v1/tickets/TGT-32-NfRV2HIYL6JlqUFTpJuc6EfUyH6q9BImaS0a5CPyOpInrO3fqk-8ee6f154afba
Content-Type: application/x-www-form-urlencoded
Body:
service=https%3A%2F%2Flocalhost%3A8443%2Fprotected
  1. step result:
ST-171-b2Sz3TseQlmFjthK7xqV-8ee6f154afba
  1. step:
Header:
GET https://localhost:8443/protected?ticket=ST-171-b2Sz3TseQlmFjthK7xqV-8ee6f154afba

I expect my protected page html format. But i saw login page. What is the problem? Could you help me?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kakawaitcommented, Jun 28, 2017

@coskundeniz89 release was upload 2 min ago, you should try it. Please re-open issue or create new one if any issue

0reactions
coskundeniz89commented, Jun 28, 2017

Ok @kakawait . Thanks for your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best Practices for REST API Error Handling - Baeldung
Learn about some of the best practices for handling REST API errors, including useful approaches for providing users with additional ...
Read more >
REST API error handling - IBM
The REST API reports errors by returning an appropriate HTTP response code, for example 404 (Not Found), and a JSON response. Any HTTP...
Read more >
HTTP Status Codes - REST API Tutorial
A 401 error response indicates that the client tried to operate on a protected resource without providing the proper authorization. It may have ......
Read more >
REST API Error Handling Best Practices
A 403 error response indicates that the client's request is formed correctly, but the REST API refuses to honor it. A 403 response...
Read more >
Best Practices for REST API Error Handling - apilayer Blog
It is highly desirable in APIs to properly handle errors and provide meaningful error messages, as it can help the API client respond...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found